diff options
author | wollman <wollman@FreeBSD.org> | 1998-08-23 03:07:17 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1998-08-23 03:07:17 +0000 |
commit | a76fb5eefabdc9418c911bf0b61768d533c15cbd (patch) | |
tree | 02b1e59b8833c25c113cc2a72ebb74ec057423bb /sys/nfsclient/bootp_subr.c | |
parent | 3846bf0ec8c81eca47577791dff72e8b96928749 (diff) | |
download | FreeBSD-src-a76fb5eefabdc9418c911bf0b61768d533c15cbd.zip FreeBSD-src-a76fb5eefabdc9418c911bf0b61768d533c15cbd.tar.gz |
Yow! Completely change the way socket options are handled, eliminating
another specialized mbuf type in the process. Also clean up some
of the cruft surrounding IPFW, multicast routing, RSVP, and other
ill-explored corners.
Diffstat (limited to 'sys/nfsclient/bootp_subr.c')
-rw-r--r-- | sys/nfsclient/bootp_subr.c | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/sys/nfsclient/bootp_subr.c b/sys/nfsclient/bootp_subr.c index 459af38..c66e384 100644 --- a/sys/nfsclient/bootp_subr.c +++ b/sys/nfsclient/bootp_subr.c @@ -1,4 +1,4 @@ -/* $Id: bootp_subr.c,v 1.13 1998/03/30 09:53:38 phk Exp $ */ +/* $Id: bootp_subr.c,v 1.14 1998/08/18 00:32:47 bde Exp $ */ /* * Copyright (c) 1995 Gordon Ross, Adam Glass @@ -264,8 +264,10 @@ bootpc_call(call,reply,procp) struct sockaddr_in *sin, sa; struct mbuf *m; struct uio auio; + struct sockopt sopt; struct iovec aio; - int error, rcvflg, timo, secs, len; + struct timeval tv; + int error, on, len, rcvflg, secs, timo; u_int tport; /* @@ -274,36 +276,26 @@ bootpc_call(call,reply,procp) if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0,procp))) goto out; - m = m_get(M_WAIT, MT_SOOPTS); - if (m == NULL) { - error = ENOBUFS; + tv.tv_sec = 1; + tv.tv_usec = 0; + bzero(&sopt, sizeof sopt); + sopt.sopt_level = SOL_SOCKET; + sopt.sopt_name = SO_RCVTIMEO; + sopt.sopt_val = &tv; + sopt.sopt_valsize = sizeof tv; + + if (error = sosetopt(so, &sopt)) goto out; - } else { - struct timeval *tv; - tv = mtod(m, struct timeval *); - m->m_len = sizeof(*tv); - tv->tv_sec = 1; - tv->tv_usec = 0; - if ((error = sosetopt(so, SOL_SOCKET, SO_RCVTIMEO, m, procp))) - goto out; - } /* * Enable broadcast. */ - { - int *on; - m = m_get(M_WAIT, MT_SOOPTS); - if (m == NULL) { - error = ENOBUFS; - goto out; - } - on = mtod(m, int *); - m->m_len = sizeof(*on); - *on = 1; - if ((error = sosetopt(so, SOL_SOCKET, SO_BROADCAST, m, procp))) - goto out; - } + on = 1; + sopt.sopt_val = &on; + sopt.sopt_valsize = sizeof on; + sopt.sopt_name = SO_BROADCAST; + if (error = sosetopt(so, &sopt)) + goto out; /* * Bind the local endpoint to a bootp client port. |