mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-17 16:10:46 +01:00
Patch from dcjm@cs.ed.ac.uk (Dave Matthews)...
Yes, I know that IFADDR ioctl is supposed to be deprecated... Note that the patch was modified by me to fit better into the driver. -DG ... While porting CAP to 386bsd/pk0.2.4 and now to FreeBSD Release 1.0 I found a couple of bugs associated with the packet filter. Here are the fixes. I'm posting them here because they apply to FreeBSD and 386bsd/pk0.2.4 and possibly to other *BSD. The first occurs when using the packet filter to write raw ethernet packets. The header consisting of the sender and destination addresses and the protocol is removed and later added back on, but with the byte order of the protocol reversed. The fix ensures that the byte order in the protocol field is swapped when it is removed. The second fix ensures that SIOCGIFADDR works for BPF as claimed in the man pages, by adding it to the ed driver. Similar fixes will be needed for other ethernet drivers. Dave Matthews.
This commit is contained in:
parent
0de1886721
commit
3579d8917b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=1049
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: if_ed.c,v 1.28 1994/01/11 23:28:21 ats Exp $
|
||||
* $Id: if_ed.c,v 1.29 1994/01/25 22:52:06 ats Exp $
|
||||
*/
|
||||
|
||||
#include "ed.h"
|
||||
@ -1945,6 +1945,15 @@ ed_ioctl(ifp, command, data)
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGIFADDR:
|
||||
{
|
||||
struct sockaddr *sa;
|
||||
sa = (struct sockaddr *)&ifr->ifr_data;
|
||||
bcopy((caddr_t)sc->arpcom.ac_enaddr,
|
||||
(caddr_t) sa->sa_data, ETHER_ADDR_LEN);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSIFFLAGS:
|
||||
/*
|
||||
* If interface is marked down and it is running, then stop it
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Id: if_ed.c,v 1.28 1994/01/11 23:28:21 ats Exp $
|
||||
* $Id: if_ed.c,v 1.29 1994/01/25 22:52:06 ats Exp $
|
||||
*/
|
||||
|
||||
#include "ed.h"
|
||||
@ -1945,6 +1945,15 @@ ed_ioctl(ifp, command, data)
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCGIFADDR:
|
||||
{
|
||||
struct sockaddr *sa;
|
||||
sa = (struct sockaddr *)&ifr->ifr_data;
|
||||
bcopy((caddr_t)sc->arpcom.ac_enaddr,
|
||||
(caddr_t) sa->sa_data, ETHER_ADDR_LEN);
|
||||
}
|
||||
break;
|
||||
|
||||
case SIOCSIFFLAGS:
|
||||
/*
|
||||
* If interface is marked down and it is running, then stop it
|
||||
|
Loading…
Reference in New Issue
Block a user