Commit Graph

768 Commits

Author SHA1 Message Date
chs 09cb38f22b expose the definitions of MIN() and MAX() in sys/param.h to the kernel
and use those in favor of a dozen copies scattered around the source tree.
2001-02-05 10:42:40 +00:00
thorpej 53c23f549a Start out with a link name that says "802.1Q VLAN", and inherit the
parent interface's as usual once we attach to the parent.  When we
detach from the parent, reset our link name to the "802.1Q VLAN" name.
2001-01-29 01:51:05 +00:00
thorpej 896cba1b56 if_alloc_sadl(): if the interface already has a link name, free
it before assigning a new one.  This is useful for interfaces
that may change their link names in the course of their existence.
2001-01-29 01:49:43 +00:00
itojun 32024e8a3d call if_alloc_sadl(). without it the following operation causes kernel panic:
# ifconfig vlan0 create
# ifconfig vlan0
2001-01-28 10:41:44 +00:00
itojun f38fdf081e change non-intuitive function name. s/rtflushit/rtflushclone1/ 2001-01-27 11:07:59 +00:00
itojun 02adaaf197 cleanup cloned route when parent route (RTF_CLONING) goes away.
adds rt_parent to link parent from child (like NRL did, ours do refcnt
rt_refcnt properly).

bsdi rt_walkbranch would speedup the processing, but since the code will not
be visited too frequently, the current code (with rt_walktree) should be okay.
2001-01-27 10:39:33 +00:00
itojun fee00b1a78 mark cloned routes with RTF_CLONED. present it with netstat -r by "c".
let static routes overwrite cloned routes, as cloned routes can come back again
if necessary.  behavior same as freebsd/bsdi, code partially from bsdi42.
(NRL rt->rt_parent was not added)
should fix PR 11916 and maybe some other PRs with ARP behavior.

recompilation of usr.sbin/route6d is suggested.
2001-01-27 04:49:31 +00:00
itojun a836499e32 make it possible to turn off ingress filter on gif/stf tunnel egress,
by using IFF_LINK2.  (part of) PR 11163 from Ken Raeburn.
2001-01-22 07:51:01 +00:00
jdolecek 34c8ae80da constify 2001-01-18 20:28:15 +00:00
thorpej 8debdb1fee Correct last commit. 2001-01-17 19:08:59 +00:00
jdolecek fd0f688850 make local const stuff as static const, so that it's pushed to text segment 2001-01-17 19:04:03 +00:00
jdolecek 03cec6311e mark local constant stuff as const, so that it's pushed to text segment 2001-01-17 18:52:41 +00:00
jdolecek 384bb56925 move local variable sdl from ieee1394_ifdetach() to ieee1394_ifattach(), so that
this file is compilable after previous change
XXX not tested
2001-01-17 18:44:14 +00:00
thorpej a4ecde8c5e If no link level name is assigned, return EADDRNOTAVAIL on
SIOCGIFADDR.
2001-01-17 15:53:43 +00:00
itojun 50f4458f06 move forward decl of rt_addrinfo upwards. 2001-01-17 15:07:07 +00:00
itojun 966b95b038 configure sdl_alen properly 2001-01-17 09:34:48 +00:00
itojun df9784d749 pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2 (UCB copyrighted).
have sys/net/route.c:rtrequest1(), which takes rt_addrinfo * as the argument.
pass rt_addrinfo all the way down to rtrequest, and ifa->ifa_rtrequest.
3rd arg of ifa->ifa_rtrequest is now rt_addrinfo * instead of sockaddr *
(almost noone is using it anyways).

benefit: the follwoing command now works.  previously we need two route(8)
invocations, "add" then "change".
# route add -inet6 default ::1 -ifp gif0

remove unsafe typecast in rtrequest(), from rtentry * to sockaddr *.  it was
introduced by 4.3BSD-reno and never corrected.

XXX is eon_rtrequest() change correct regarding to 3rd arg?
eon_rtrequest() and rtrequest() were incorrect since 4.3BSD-reno,
so i do not have correct answer in the source code.
someone with more clue about netiso-over-ip, please help.
2001-01-17 04:05:41 +00:00
thorpej fc5dafc79b Fix a rather annoying problem where the sockaddr_dl which holds
the link level name for the interface (ifp->if_sadl) is allocated
before ifp->if_addrlen is initialized, which could lead to allocating
too little space for the link level address.

Do this by splitting allocation of the link level name out of
if_attach() and into if_alloc_sadl(), which is normally called
by functions like ether_ifattach().  Network interfaces which
don't have a link-specific attach routine must call if_alloc_sadl()
themselves (example: gif).

Link level names are freed by if_free_sadl(), which can be called
from e.g. ether_ifdetach().  Drivers never need call if_free_sadl()
themselves as if_detach() will do it if it is not already done.

While here, add the ability to pass an AF_LINK address to
SIOCSIFADDR in ether_ioctl() (this is what caused me to notice
the problem that the above fixes).
2001-01-17 00:30:49 +00:00
thorpej f64af41401 No need to reference ifnet_addrs[]. 2001-01-16 21:18:56 +00:00
itojun 72f7f224db run IPCP only if we have IPv4 in kernel 2001-01-16 15:28:27 +00:00
thorpej 569e9a31e2 For SLIP/STRIP/PPP, use generic soft interrupts, if available. 2001-01-15 16:33:30 +00:00
martin 89e8f275be Don't peek at part of a structure via fuword. Does not work well on
64bit architectures. XXX - have to check other changes in the I4B
distribution, this had been fixed there a long time ago.
2001-01-15 13:40:35 +00:00
thorpej 1cdefa9f66 Fix a comment. 2001-01-12 19:38:46 +00:00
thorpej ba4e91812d After freeing the input buffer, set the pointer to it to NULL. 2001-01-12 19:27:32 +00:00
thorpej acd96e1307 Don't use splimp() to block both net and tty interrupts. Instead,
block both interrupt levels as appropriate.
2001-01-12 19:26:48 +00:00
thorpej 6f85104748 Sync with if_sl.c,v 1.67:
Defer output processing to the software interrupt.

Note, that in the process of doing this, I discovered several
very broken things about this driver, which are not fixed with
this commit.  It should work as well as it previously did, but
this code could be seriously improved.  As soon as I can find
my second Metricom radio, I'll give it a proper shakedown.
2001-01-12 19:03:24 +00:00
thorpej 455e3228dd Sync if if_sl.c,v 1.66:
Move the VJ uncompress code into the software interrupt.
2001-01-11 22:56:51 +00:00
thorpej c292853354 Plug a memory leak. 2001-01-11 22:43:02 +00:00
thorpej 7c1a1a3ae8 Process STRIP software interrupts. 2001-01-11 22:32:21 +00:00
thorpej 1ce7cbc90b Sync with if_sl.c,v 1.65:
Once we have a complete frame, schedule a STRIP software interrupt,
and manipulate ipintrq from there.  This will allow us to clean up
the use of splimp() in this file later.
2001-01-11 22:31:49 +00:00
thorpej a5ee0c0a19 Sync with if_sl.c,v 1.64:
Make the buffer management in STRIP just a little less evil.
2001-01-11 22:23:11 +00:00
thorpej 7c5fe175c0 Defer output processing to the software interrupt. 2001-01-11 21:15:58 +00:00
thorpej 4c9cb837ba Move the VJ uncompress code into the software interrupt. 2001-01-10 23:29:42 +00:00
itojun ea2d93c355 fix indentation 2001-01-10 01:16:59 +00:00
thorpej f5428a0a17 Fix oversight in slip softintr changes. 2001-01-09 20:20:13 +00:00
thorpej efed547b78 Once we have a complete frame, schedule a SLIP software interrupt,
and manipulate ipintrq from there.  This will allow us to clean up
the use of splimp() in this file later.
2001-01-09 05:04:23 +00:00
thorpej 30be6aa8b6 Add NETISRs for SLIP and STRIP. (Geez, I wish we had the softintr
API everywhere...)
2001-01-09 05:03:10 +00:00
thorpej 692a2bc939 Make the buffer management in SLIP just a little less evil. 2001-01-09 04:42:48 +00:00
thorpej c5acd6aad5 Fix a typo in the ALTQ changes. 2001-01-08 23:43:34 +00:00
martin 6b82e7fe42 64bit police.
Rumors say there are archs without ISA busses, so avoid including
(uneccesarily) isa bus headers in MI files.
XXX this is the minimal solution, layer interface calls will have
XXX to be revisited later
2001-01-07 21:47:24 +00:00
enami 0e081e1b48 Missing newline in log messsage. 2001-01-04 00:17:52 +00:00
thorpej d2bbed89e7 Fix non-blocking BPF reads, from Guy Harris, kern/11836. 2000-12-29 01:55:49 +00:00
thorpej ad5b855ef0 Back out the sledgehammer damage applied by wiz while I was out for
the holiday.
2000-12-28 21:40:59 +00:00
augustss 79431d7824 Simplify case statement a tiny bit. 2000-12-26 23:54:34 +00:00
wiz 32e20d8993 Back out previous change. It causes NAT to fail, and was CLEARLY
NOT TESTED before it was committed.
2000-12-25 02:00:46 +00:00
thorpej f9fd00d8e7 Fix a silly bug in the ALTQ version of IFQ_DEQUEUE(). 2000-12-23 19:00:18 +00:00
thorpej d0357bdb4f Slight adjustment to how pfil_head's are registered. Instead of a
"key" and a "dlt", use a "type" (PFIL_TYPE_{AF,IFNET} for now) and
a val/ptr appropriate for that type.  This allows for more future
flexibility with the pfil_hook mechanism.
2000-12-22 20:01:17 +00:00
thorpej 8a56f72a7c Oops, make this build without ALTQ again. 2000-12-18 21:13:14 +00:00
thorpej 831d5b8d43 Add SIOCGIFDLT, which will fetch the data link type (DLT_* constant)
for a given network interface.
2000-12-18 21:05:03 +00:00
thorpej 0b541534c5 Add an "ifr_dlt" alias for the union in struct ifreq. 2000-12-18 21:03:34 +00:00