aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2013-01-31 08:55:21 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2013-01-31 08:55:21 +0000
commit9711a168b937802c369ef4241590f671cbee9243 (patch)
treee3ea2bc458475248ba21882d2e6ebd842532550e /libexec
parentb8f355bf5068cb898f4759ecba617cd635fbe08c (diff)
downloadsrc-9711a168b937802c369ef4241590f671cbee9243.tar.gz
src-9711a168b937802c369ef4241590f671cbee9243.zip
Retire struct sockaddr_inarp.
Since ARP and routing are separated, "proxy only" entries don't have any meaning, thus we don't need additional field in sockaddr to pass SIN_PROXY flag. New kernel is binary compatible with old tools, since sizes of sockaddr_inarp and sockaddr_in match, and sa_family are filled with same value. The structure declaration is left for compatibility with third party software, but in tree code no longer use it. Reviewed by: ru, andre, net@
Notes
Notes: svn path=/head/; revision=246143
Diffstat (limited to 'libexec')
-rw-r--r--libexec/bootpd/rtmsg.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/libexec/bootpd/rtmsg.c b/libexec/bootpd/rtmsg.c
index 8b81dabcccf4..c075bc5dae06 100644
--- a/libexec/bootpd/rtmsg.c
+++ b/libexec/bootpd/rtmsg.c
@@ -106,9 +106,9 @@ static void getsocket () {
}
static struct sockaddr_in so_mask = {8, 0, 0, { 0xffffffff}};
-static struct sockaddr_inarp blank_sin = {sizeof(blank_sin), AF_INET }, sin_m;
+static struct sockaddr_in blank_sin = {sizeof(blank_sin), AF_INET }, sin_m;
static struct sockaddr_dl blank_sdl = {sizeof(blank_sdl), AF_LINK }, sdl_m;
-static int expire_time, flags, export_only, doing_proxy;
+static int expire_time, flags, doing_proxy;
static struct {
struct rt_msghdr m_rtm;
char m_space[512];
@@ -122,7 +122,7 @@ int bsd_arp_set(ia, eaddr, len)
char *eaddr;
int len;
{
- register struct sockaddr_inarp *sin = &sin_m;
+ register struct sockaddr_in *sin = &sin_m;
register struct sockaddr_dl *sdl;
register struct rt_msghdr *rtm = &(m_rtmsg.m_rtm);
u_char *ea;
@@ -137,7 +137,7 @@ int bsd_arp_set(ia, eaddr, len)
ea = (u_char *)LLADDR(&sdl_m);
bcopy(eaddr, ea, len);
sdl_m.sdl_alen = len;
- doing_proxy = flags = export_only = expire_time = 0;
+ doing_proxy = flags = expire_time = 0;
/* make arp entry temporary */
clock_gettime(CLOCK_MONOTONIC, &tp);
@@ -148,7 +148,7 @@ tryagain:
report(LOG_WARNING, "rtmget: %s", strerror(errno));
return (1);
}
- sin = (struct sockaddr_inarp *)(rtm + 1);
+ sin = (struct sockaddr_in *)(rtm + 1);
sdl = (struct sockaddr_dl *)(sin->sin_len + (char *)sin);
if (sin->sin_addr.s_addr == sin_m.sin_addr.s_addr) {
if (sdl->sdl_family == AF_LINK &&
@@ -163,13 +163,6 @@ tryagain:
inet_ntoa(sin->sin_addr));
return (1);
}
- if (sin_m.sin_other & SIN_PROXY) {
- report(LOG_WARNING,
- "set: proxy entry exists for non 802 device\n");
- return(1);
- }
- sin_m.sin_other = SIN_PROXY;
- export_only = 1;
goto tryagain;
}
overwrite:
@@ -209,14 +202,9 @@ static int rtmsg(cmd)
rtm->rtm_rmx.rmx_expire = expire_time;
rtm->rtm_inits = RTV_EXPIRE;
rtm->rtm_flags |= (RTF_HOST | RTF_STATIC | RTF_LLDATA);
- sin_m.sin_other = 0;
if (doing_proxy) {
- if (export_only)
- sin_m.sin_other = SIN_PROXY;
- else {
- rtm->rtm_addrs |= RTA_NETMASK;
- rtm->rtm_flags &= ~RTF_HOST;
- }
+ rtm->rtm_addrs |= RTA_NETMASK;
+ rtm->rtm_flags &= ~RTF_HOST;
}
/* FALLTHROUGH */
case RTM_GET: