Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dhcp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
70
Issues
70
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
dhcp
Commits
d4feef65
Commit
d4feef65
authored
Jan 25, 2000
by
Ted Lemon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixups for haddr/htype->hbuf
parent
f6a30e8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
40 deletions
+44
-40
common/dlpi.c
common/dlpi.c
+26
-23
common/lpf.c
common/lpf.c
+7
-7
common/nit.c
common/nit.c
+11
-10
No files found.
common/dlpi.c
View file @
d4feef65
...
...
@@ -70,7 +70,7 @@
#ifndef lint
static
char
copyright
[]
=
"$Id: dlpi.c,v 1.1
6 1999/10/14 17:44:02
mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.
\n
"
;
"$Id: dlpi.c,v 1.1
7 2000/01/25 01:05:01
mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.
\n
"
;
#endif
/* not lint */
#include "dhcpd.h"
...
...
@@ -211,14 +211,14 @@ int if_register_dlpi (info)
switch
(
dlp
->
info_ack
.
dl_mac_type
)
{
case
DL_CSMACD
:
/* IEEE 802.3 */
case
DL_ETHER
:
info
->
hw_address
.
h
type
=
HTYPE_ETHER
;
info
->
hw_address
.
h
buf
[
0
]
=
HTYPE_ETHER
;
break
;
/* adding token ring 5/1999 - mayer@ping.at */
case
DL_TPR
:
info
->
hw_address
.
h
type
=
HTYPE_IEEE802
;
info
->
hw_address
.
h
buf
[
0
]
=
HTYPE_IEEE802
;
break
;
case
DL_FDDI
:
info
->
hw_address
.
h
type
=
HTYPE_FDDI
;
info
->
hw_address
.
h
buf
[
0
]
=
HTYPE_FDDI
;
break
;
default:
log_fatal
(
"%s: unknown DLPI MAC type %ld"
,
...
...
@@ -259,8 +259,8 @@ int if_register_dlpi (info)
info
->
name
);
}
info
->
hw_address
.
hlen
=
dlp
->
physaddr_ack
.
dl_addr_length
;
memcpy
(
info
->
hw_address
.
haddr
,
info
->
hw_address
.
hlen
=
dlp
->
physaddr_ack
.
dl_addr_length
+
1
;
memcpy
(
&
info
->
hw_address
.
hbuf
[
1
]
,
(
char
*
)
buf
+
dlp
->
physaddr_ack
.
dl_addr_offset
,
dlp
->
physaddr_ack
.
dl_addr_length
);
...
...
@@ -341,9 +341,9 @@ void if_register_send (info)
if
(
!
quiet_interface_discovery
)
log_info
(
"Sending on DLPI/%s/%s%s%s"
,
info
->
name
,
print_hw_addr
(
info
->
hw_address
.
h
type
,
info
->
hw_address
.
hlen
,
info
->
hw_address
.
haddr
),
print_hw_addr
(
info
->
hw_address
.
h
buf
[
0
]
,
info
->
hw_address
.
hlen
-
1
,
&
info
->
hw_address
.
hbuf
[
1
]
),
(
info
->
shared_network
?
"/"
:
""
),
(
info
->
shared_network
?
info
->
shared_network
->
name
:
""
));
...
...
@@ -424,9 +424,9 @@ void if_register_receive (info)
if
(
!
quiet_interface_discovery
)
log_info
(
"Listening on DLPI/%s/%s%s%s"
,
info
->
name
,
print_hw_addr
(
info
->
hw_address
.
h
type
,
info
->
hw_address
.
hlen
,
info
->
hw_address
.
haddr
),
print_hw_addr
(
info
->
hw_address
.
h
buf
[
0
]
,
info
->
hw_address
.
hlen
-
1
,
&
info
->
hw_address
.
hbuf
[
1
]
),
(
info
->
shared_network
?
"/"
:
""
),
(
info
->
shared_network
?
info
->
shared_network
->
name
:
""
));
...
...
@@ -489,7 +489,8 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto)
/* Setup the destination address */
if
(
hto
&&
hto
->
hlen
==
interface
->
hw_address
.
hlen
)
{
dlpi_makeaddr
(
hto
->
haddr
,
hto
->
hlen
,
sap
,
saplen
,
dstaddr
);
dlpi_makeaddr
(
&
hto
->
hbuf
[
1
],
hto
->
hlen
-
1
,
sap
,
saplen
,
dstaddr
);
}
else
{
/* XXX: Assumes broadcast addr is all ones */
/* Really should get the broadcast address as part of the
...
...
@@ -497,11 +498,12 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto)
*/
unsigned
char
bcast_ether
[
DLPI_MAXDLADDR
];
memset
((
char
*
)
bcast_ether
,
0xFF
,
interface
->
hw_address
.
hlen
);
dlpi_makeaddr
(
bcast_ether
,
interface
->
hw_address
.
hlen
,
sap
,
saplen
,
dstaddr
);
memset
((
char
*
)
bcast_ether
,
0xFF
,
interface
->
hw_address
.
hlen
-
1
);
dlpi_makeaddr
(
bcast_ether
,
interface
->
hw_address
.
hlen
-
1
,
sap
,
saplen
,
dstaddr
);
}
addrlen
=
interface
->
hw_address
.
hlen
+
ABS
(
saplen
);
addrlen
=
interface
->
hw_address
.
hlen
-
1
+
ABS
(
saplen
);
/* Send the packet down the wire... */
result
=
dlpiunitdatareq
(
interface
->
wfdesc
,
dstaddr
,
addrlen
,
...
...
@@ -548,13 +550,14 @@ ssize_t receive_packet (interface, buf, len, from, hfrom)
/* Copy sender info */
/* XXX: Assumes ethernet, where SAP comes at end of haddr */
saplen
=
-
2
;
if
(
hfrom
&&
srcaddrlen
==
ABS
(
saplen
)
+
interface
->
hw_address
.
hlen
)
{
hfrom
->
htype
=
interface
->
hw_address
.
htype
;
hfrom
->
hlen
=
interface
->
hw_address
.
hlen
;
dlpi_parseaddr
(
srcaddr
,
hfrom
->
haddr
,
interface
->
hw_address
.
hlen
,
sap
,
saplen
);
if
(
hfrom
&&
(
srcaddrlen
==
ABS
(
saplen
)
+
interface
->
hw_address
.
hlen
-
1
))
{
hfrom
->
hbuf
[
0
]
=
interface
->
hw_address
.
hbuf
[
0
];
hfrom
->
hlen
=
interface
->
hw_address
.
hlen
;
dlpi_parseaddr
(
srcaddr
,
&
hfrom
->
hbuf
[
1
],
interface
->
hw_address
.
hlen
-
1
,
sap
,
saplen
);
}
else
if
(
hfrom
)
{
memset
((
char
*
)
hfrom
,
'\0'
,
sizeof
(
*
hfrom
)
);
memset
(
hfrom
,
'\0'
,
sizeof
*
hfrom
);
}
#endif
...
...
common/lpf.c
View file @
d4feef65
...
...
@@ -23,7 +23,7 @@
#ifndef lint
static
char
copyright
[]
=
"$Id: lpf.c,v 1.1
8 1999/10/21 12:31:53
mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.
\n
"
;
"$Id: lpf.c,v 1.1
9 2000/01/25 01:07:19
mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.
\n
"
;
#endif
/* not lint */
#include "dhcpd.h"
...
...
@@ -113,9 +113,9 @@ void if_register_send (info)
if
(
!
quiet_interface_discovery
)
log_info
(
"Sending on LPF/%s/%s%s%s"
,
info
->
name
,
print_hw_addr
(
info
->
hw_address
.
h
type
,
info
->
hw_address
.
hlen
,
info
->
hw_address
.
haddr
),
print_hw_addr
(
info
->
hw_address
.
h
buf
[
0
]
,
info
->
hw_address
.
hlen
-
1
,
&
info
->
hw_address
.
hbuf
[
1
]
),
(
info
->
shared_network
?
"/"
:
""
),
(
info
->
shared_network
?
info
->
shared_network
->
name
:
""
));
...
...
@@ -147,9 +147,9 @@ void if_register_receive (info)
if
(
!
quiet_interface_discovery
)
log_info
(
"Listening on LPF/%s/%s%s%s"
,
info
->
name
,
print_hw_addr
(
info
->
hw_address
.
h
type
,
info
->
hw_address
.
hlen
,
info
->
hw_address
.
haddr
),
print_hw_addr
(
info
->
hw_address
.
h
buf
[
0
]
,
info
->
hw_address
.
hlen
-
1
,
&
info
->
hw_address
.
hbuf
[
1
]
),
(
info
->
shared_network
?
"/"
:
""
),
(
info
->
shared_network
?
info
->
shared_network
->
name
:
""
));
...
...
common/nit.c
View file @
d4feef65
...
...
@@ -23,7 +23,7 @@
#ifndef lint
static
char
copyright
[]
=
"$Id: nit.c,v 1.2
5 1999/10/07 06:47:50
mellon Exp $ Copyright (c) 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.
\n
"
;
"$Id: nit.c,v 1.2
6 2000/01/25 01:07:41
mellon Exp $ Copyright (c) 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.
\n
"
;
#endif
/* not lint */
#include "dhcpd.h"
...
...
@@ -97,9 +97,10 @@ int if_register_nit (info)
info
->
name
);
/* XXX code below assumes ethernet interface! */
info
->
hw_address
.
hlen
=
6
;
info
->
hw_address
.
htype
=
ARPHRD_ETHER
;
memcpy
(
info
->
hw_address
.
haddr
,
ifr
.
ifr_ifru
.
ifru_addr
.
sa_data
,
6
);
info
->
hw_address
.
hlen
=
7
;
info
->
hw_address
.
hbuf
[
0
]
=
ARPHRD_ETHER
;
memcpy
(
&
info
->
hw_address
.
jbuf
[
1
],
ifr
.
ifr_ifru
.
ifru_addr
.
sa_data
,
6
);
if
(
ioctl
(
sock
,
I_PUSH
,
"pf"
)
<
0
)
log_fatal
(
"Can't push packet filter onto NIT for %s: %m"
,
...
...
@@ -137,9 +138,9 @@ void if_register_send (info)
#endif
if
(
!
quiet_interface_discovery
)
log_info
(
"Sending on NIT/%s%s%s"
,
print_hw_addr
(
info
->
hw_address
.
h
type
,
info
->
hw_address
.
hlen
,
info
->
hw_address
.
haddr
),
print_hw_addr
(
info
->
hw_address
.
h
buf
[
0
]
,
info
->
hw_address
.
hlen
-
1
,
&
info
->
hw_address
.
hbuf
[
1
]
),
(
info
->
shared_network
?
"/"
:
""
),
(
info
->
shared_network
?
info
->
shared_network
->
name
:
""
));
...
...
@@ -221,9 +222,9 @@ void if_register_receive (info)
if
(
!
quiet_interface_discovery
)
log_info
(
"Listening on NIT/%s%s%s"
,
print_hw_addr
(
info
->
hw_address
.
h
type
,
info
->
hw_address
.
hlen
,
info
->
hw_address
.
haddr
),
print_hw_addr
(
info
->
hw_address
.
h
buf
[
0
]
,
info
->
hw_address
.
hlen
-
1
,
&
info
->
hw_address
.
hbuf
[
1
]
),
(
info
->
shared_network
?
"/"
:
""
),
(
info
->
shared_network
?
info
->
shared_network
->
name
:
""
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment