Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107550116
D28305.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D28305.diff
View Options
diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c
--- a/sbin/pfctl/pfctl_altq.c
+++ b/sbin/pfctl/pfctl_altq.c
@@ -98,11 +98,7 @@
double);
static double sc_x2y(struct service_curve *, double);
-#ifdef __FreeBSD__
-u_int64_t getifspeed(int, char *);
-#else
u_int32_t getifspeed(char *);
-#endif
u_long getifmtu(char *);
int eval_queue_opts(struct pf_altq *, struct node_queue_opt *,
u_int64_t);
@@ -317,11 +313,7 @@
if (bw->bw_absolute > 0)
pa->ifbandwidth = bw->bw_absolute;
else
-#ifdef __FreeBSD__
- if ((rate = getifspeed(pf->dev, pa->ifname)) == 0) {
-#else
if ((rate = getifspeed(pa->ifname)) == 0) {
-#endif
fprintf(stderr, "interface %s does not know its bandwidth, "
"please specify an absolute bandwidth\n",
pa->ifname);
@@ -1254,26 +1246,6 @@
return (buf);
}
-#ifdef __FreeBSD__
-/*
- * XXX
- * FreeBSD does not have SIOCGIFDATA.
- * To emulate this, DIOCGIFSPEED ioctl added to pf.
- */
-u_int64_t
-getifspeed(int pfdev, char *ifname)
-{
- struct pf_ifspeed io;
-
- bzero(&io, sizeof io);
- if (strlcpy(io.ifname, ifname, IFNAMSIZ) >=
- sizeof(io.ifname))
- errx(1, "getifspeed: strlcpy");
- if (ioctl(pfdev, DIOCGIFSPEED, &io) == -1)
- err(1, "DIOCGIFSPEED");
- return (io.baudrate);
-}
-#else
u_int32_t
getifspeed(char *ifname)
{
@@ -1291,7 +1263,6 @@
err(1, "SIOCGIFDATA");
return ((u_int32_t)ifrdat.ifi_baudrate);
}
-#endif
u_long
getifmtu(char *ifname)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 16, 6:40 PM (21 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15828158
Default Alt Text
D28305.diff (1 KB)
Attached To
Mode
D28305: pfctl: FreeBSD now supports DIOCGIFSPEED
Attached
Detach File
Event Timeline
Log In to Comment