diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2018-05-25 10:38:02 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2018-05-25 10:38:02 +0300 |
commit | 969ba07f29a93180a0a8a6e94dc4205a5b6cf531 (patch) | |
tree | f20fa1fdd2706aad69b8772962a21b4a3e92b0bb /accel-pppd/libnetlink/iputils.c | |
parent | 4e39b82b126bcee5b19f482a0f5048b25692abb3 (diff) | |
download | accel-ppp-969ba07f29a93180a0a8a6e94dc4205a5b6cf531.tar.gz accel-ppp-969ba07f29a93180a0a8a6e94dc4205a5b6cf531.zip |
ifcfg: assign address using ipaddr_add_peer instead SIOCSIFADDR/SIOCSIFDSTADDR
Diffstat (limited to 'accel-pppd/libnetlink/iputils.c')
-rw-r--r-- | accel-pppd/libnetlink/iputils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/accel-pppd/libnetlink/iputils.c b/accel-pppd/libnetlink/iputils.c index ad6005f..1f0592c 100644 --- a/accel-pppd/libnetlink/iputils.c +++ b/accel-pppd/libnetlink/iputils.c @@ -359,7 +359,7 @@ int __export ipaddr_add(int ifindex, in_addr_t addr, int mask) return r; } -int __export ipaddr_add_peer(int ifindex, in_addr_t addr, in_addr_t peer_addr) +int __export ipaddr_add_peer(int ifindex, in_addr_t addr, in_addr_t peer_addr, int mask) { struct ipaddr_req { struct nlmsghdr n; @@ -379,7 +379,7 @@ int __export ipaddr_add_peer(int ifindex, in_addr_t addr, in_addr_t peer_addr) req.n.nlmsg_type = RTM_NEWADDR; req.i.ifa_family = AF_INET; req.i.ifa_index = ifindex; - req.i.ifa_prefixlen = 32; + req.i.ifa_prefixlen = mask; addattr32(&req.n, sizeof(req), IFA_LOCAL, addr); addattr32(&req.n, sizeof(req), IFA_ADDRESS, peer_addr); |