-
Notifications
You must be signed in to change notification settings - Fork 0
/
patch-dhcp6s.c
62 lines (60 loc) · 1.12 KB
/
patch-dhcp6s.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--- dhcp6s.c.orig 2017-02-28 19:06:15.000000000 +0000
+++ dhcp6s.c 2024-04-13 13:30:00.000000000 +0000
@@ -149,9 +149,6 @@
static int ctldigestlen;
static char *pid_file = DHCP6S_PIDFILE;
-static inline int get_val32 __P((char **, int *, u_int32_t *));
-static inline int get_val __P((char **, int *, void *, size_t));
-
static void usage __P((void));
static void server6_init __P((void));
static void server6_mainloop __P((void));
@@ -643,49 +640,6 @@
(void)dhcp6_ctl_readcommand(&r);
}
}
-}
-
-static inline int
-get_val32(bpp, lenp, valp)
- char **bpp;
- int *lenp;
- u_int32_t *valp;
-{
- char *bp = *bpp;
- int len = *lenp;
- u_int32_t i32;
-
- if (len < sizeof(*valp))
- return (-1);
-
- memcpy(&i32, bp, sizeof(i32));
- *valp = ntohl(i32);
-
- *bpp = bp + sizeof(*valp);
- *lenp = len - sizeof(*valp);
-
- return (0);
-}
-
-static inline int
-get_val(bpp, lenp, valp, vallen)
- char **bpp;
- int *lenp;
- void *valp;
- size_t vallen;
-{
- char *bp = *bpp;
- int len = *lenp;
-
- if (len < vallen)
- return (-1);
-
- memcpy(valp, bp, vallen);
-
- *bpp = bp + vallen;
- *lenp = len - vallen;
-
- return (0);
}
static int