projects
/
project
/
odhcpd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dhcpv4: add in_addr dhcpv4_mask and in_addr dhcpv4_addr to struct interface
[project/odhcpd.git]
/
src
/
odhcpd.c
diff --git
a/src/odhcpd.c
b/src/odhcpd.c
index
52bca13
..
aad5b37
100644
(file)
--- a/
src/odhcpd.c
+++ b/
src/odhcpd.c
@@
-113,11
+113,11
@@
int odhcpd_open_rtnl(void)
// Read IPv6 MTU for interface
// Read IPv6 MTU for interface
-int odhcpd_get_interface_
mtu(const char *ifname
)
+int odhcpd_get_interface_
config(const char *ifname, const char *what
)
{
char buf[64];
{
char buf[64];
- const char *sysctl_pattern = "/proc/sys/net/ipv6/conf/%s/
mtu
";
- snprintf(buf, sizeof(buf), sysctl_pattern, ifname);
+ const char *sysctl_pattern = "/proc/sys/net/ipv6/conf/%s/
%s
";
+ snprintf(buf, sizeof(buf), sysctl_pattern, ifname
, what
);
int fd = open(buf, O_RDONLY);
ssize_t len = read(fd, buf, sizeof(buf) - 1);
int fd = open(buf, O_RDONLY);
ssize_t len = read(fd, buf, sizeof(buf) - 1);
@@
-126,10
+126,8
@@
int odhcpd_get_interface_mtu(const char *ifname)
if (len < 0)
return -1;
if (len < 0)
return -1;
-
buf[len] = 0;
return atoi(buf);
buf[len] = 0;
return atoi(buf);
-
}
}