aboutsummaryrefslogtreecommitdiff
path: root/networking/libiproute/iplink.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-02-11 14:55:46 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-02-11 14:55:46 +0100
commitba3b9dbf065438402d89655d7baefb0ccc6f0663 (patch)
tree4669edd0fb031940a794eaf8942bdbf314efea2e /networking/libiproute/iplink.c
parentd3162773d5c722cc1f5c5b1ea5171c8d3c208135 (diff)
downloadbusybox-w32-ba3b9dbf065438402d89655d7baefb0ccc6f0663.tar.gz
busybox-w32-ba3b9dbf065438402d89655d7baefb0ccc6f0663.tar.bz2
busybox-w32-ba3b9dbf065438402d89655d7baefb0ccc6f0663.zip
libbb: introduce and use bb_getsockname()
function old new delta bb_getsockname - 18 +18 xrtnl_open 88 83 -5 do_iplink 1216 1209 -7 arping_main 1686 1668 -18 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/3 up/down: 18/-30) Total: -12 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/libiproute/iplink.c')
-rw-r--r--networking/libiproute/iplink.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c
index aef5f6490..f38fba055 100644
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
@@ -132,7 +132,6 @@ static int get_address(char *dev, int *htype)
132{ 132{
133 struct ifreq ifr; 133 struct ifreq ifr;
134 struct sockaddr_ll me; 134 struct sockaddr_ll me;
135 socklen_t alen;
136 int s; 135 int s;
137 136
138 s = xsocket(PF_PACKET, SOCK_DGRAM, 0); 137 s = xsocket(PF_PACKET, SOCK_DGRAM, 0);
@@ -146,8 +145,7 @@ static int get_address(char *dev, int *htype)
146 me.sll_ifindex = ifr.ifr_ifindex; 145 me.sll_ifindex = ifr.ifr_ifindex;
147 me.sll_protocol = htons(ETH_P_LOOP); 146 me.sll_protocol = htons(ETH_P_LOOP);
148 xbind(s, (struct sockaddr*)&me, sizeof(me)); 147 xbind(s, (struct sockaddr*)&me, sizeof(me));
149 alen = sizeof(me); 148 bb_getsockname(s, (struct sockaddr*)&me, sizeof(me));
150 getsockname(s, (struct sockaddr*)&me, &alen);
151 //never happens: 149 //never happens:
152 //if (getsockname(s, (struct sockaddr*)&me, &alen) == -1) 150 //if (getsockname(s, (struct sockaddr*)&me, &alen) == -1)
153 // bb_perror_msg_and_die("getsockname"); 151 // bb_perror_msg_and_die("getsockname");