diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2018-05-25 12:44:41 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2018-05-25 12:44:41 +0300 |
commit | fd996b7dc4464bbfccafaa4ba52246258fc4ae89 (patch) | |
tree | 10af783d085973cfa9ec8278673de35c75e81625 /accel-pppd/libnetlink | |
parent | b3ca0ac6044b89d77db51f07769a564c705237cc (diff) | |
download | accel-ppp-fd996b7dc4464bbfccafaa4ba52246258fc4ae89.tar.gz accel-ppp-fd996b7dc4464bbfccafaa4ba52246258fc4ae89.zip |
ifcfg: assign p-t-p address if mask=32 and regular address in other cases
Diffstat (limited to 'accel-pppd/libnetlink')
-rw-r--r-- | accel-pppd/libnetlink/iputils.c | 4 | ||||
-rw-r--r-- | accel-pppd/libnetlink/iputils.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/accel-pppd/libnetlink/iputils.c b/accel-pppd/libnetlink/iputils.c index 1f0592cb..ad6005f1 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 mask) +int __export ipaddr_add_peer(int ifindex, in_addr_t addr, in_addr_t peer_addr) { 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, i req.n.nlmsg_type = RTM_NEWADDR; req.i.ifa_family = AF_INET; req.i.ifa_index = ifindex; - req.i.ifa_prefixlen = mask; + req.i.ifa_prefixlen = 32; addattr32(&req.n, sizeof(req), IFA_LOCAL, addr); addattr32(&req.n, sizeof(req), IFA_ADDRESS, peer_addr); diff --git a/accel-pppd/libnetlink/iputils.h b/accel-pppd/libnetlink/iputils.h index 9451b065..66aa9747 100644 --- a/accel-pppd/libnetlink/iputils.h +++ b/accel-pppd/libnetlink/iputils.h @@ -14,7 +14,7 @@ int iplink_vlan_del(int ifindex); int iplink_vlan_get_vid(int ifindex, int *iflink); int ipaddr_add(int ifindex, in_addr_t addr, int mask); -int ipaddr_add_peer(int ifindex, in_addr_t addr, in_addr_t peer_addr, int mask); +int ipaddr_add_peer(int ifindex, in_addr_t addr, in_addr_t peer_addr); int ipaddr_del(int ifindex, in_addr_t addr, int mask); int ipaddr_del_peer(int ifindex, in_addr_t addr, in_addr_t peer); |