View | Details | Raw Unified | Return to bug 194453
Collapse All | Expand All

(-)sbin/ipfw/dummynet.c (-4 / +5 lines)
Lines 23-28 Link Here
23
 */
23
 */
24
24
25
#define NEW_AQM
25
#define NEW_AQM
26
#include <sys/limits.h>
26
#include <sys/types.h>
27
#include <sys/types.h>
27
#include <sys/socket.h>
28
#include <sys/socket.h>
28
/* XXX there are several sysctl leftover here */
29
/* XXX there are several sysctl leftover here */
Lines 794-800 is_valid_number(const char *s) Link Here
794
 * set clocking interface or bandwidth value
795
 * set clocking interface or bandwidth value
795
 */
796
 */
796
static void
797
static void
797
read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen)
798
read_bandwidth(char *arg, uint32_t *bandwidth, char *if_name, int namelen)
798
{
799
{
799
	if (*bandwidth != -1)
800
	if (*bandwidth != -1)
800
		warnx("duplicate token, override bandwidth value!");
801
		warnx("duplicate token, override bandwidth value!");
Lines 810-816 read_bandwidth(char *arg, int *bandwidth Link Here
810
		strlcpy(if_name, arg, namelen);
811
		strlcpy(if_name, arg, namelen);
811
		*bandwidth = 0;
812
		*bandwidth = 0;
812
	} else {	/* read bandwidth value */
813
	} else {	/* read bandwidth value */
813
		int bw;
814
		uint64_t bw;
814
		char *end = NULL;
815
		char *end = NULL;
815
816
816
		bw = strtoul(arg, &end, 0);
817
		bw = strtoul(arg, &end, 0);
Lines 829-838 read_bandwidth(char *arg, int *bandwidth Link Here
829
		    _substrcmp2(end, "by", "bytes") == 0)
830
		    _substrcmp2(end, "by", "bytes") == 0)
830
			bw *= 8;
831
			bw *= 8;
831
832
832
		if (bw < 0)
833
		if (bw > UINT_MAX)
833
			errx(EX_DATAERR, "bandwidth too large");
834
			errx(EX_DATAERR, "bandwidth too large");
834
835
835
		*bandwidth = bw;
836
		*bandwidth = (uint32_t)bw;
836
		if (if_name)
837
		if (if_name)
837
			if_name[0] = '\0';
838
			if_name[0] = '\0';
838
	}
839
	}
(-)sys/netinet/ip_dummynet.h (-2 / +2 lines)
Lines 131-137 struct dn_link { Link Here
131
	 * XXX what about burst ?
131
	 * XXX what about burst ?
132
	 */
132
	 */
133
	int32_t		link_nr;
133
	int32_t		link_nr;
134
	int		bandwidth;	/* bit/s or bits/tick.   */
134
	uint32_t	bandwidth;	/* bit/s or bits/tick.   */
135
	int		delay;		/* ms and ticks */
135
	int		delay;		/* ms and ticks */
136
	uint64_t	burst;		/* scaled. bits*Hz  XXX */
136
	uint64_t	burst;		/* scaled. bits*Hz  XXX */
137
};
137
};
Lines 216-222 struct dn_profile { Link Here
216
	char	name[ED_MAX_NAME_LEN];
216
	char	name[ED_MAX_NAME_LEN];
217
	int	link_nr;
217
	int	link_nr;
218
	int	loss_level;
218
	int	loss_level;
219
	int	bandwidth;			// XXX use link bandwidth?
219
	uint32_t	bandwidth;			// XXX use link bandwidth?
220
	int	samples_no;			/* actual len of samples[] */
220
	int	samples_no;			/* actual len of samples[] */
221
	int	samples[ED_MAX_SAMPLES_NO];	/* may be shorter */
221
	int	samples[ED_MAX_SAMPLES_NO];	/* may be shorter */
222
};
222
};
(-)sys/netpfil/ipfw/ip_dn_glue.c (-2 / +2 lines)
Lines 166-172 struct dn_pipe7 { /* a pipe */ Link Here
166
	SLIST_ENTRY(dn_pipe7)    next;   /* linked list in a hash slot */
166
	SLIST_ENTRY(dn_pipe7)    next;   /* linked list in a hash slot */
167
167
168
	int pipe_nr ;       /* number   */
168
	int pipe_nr ;       /* number   */
169
	int bandwidth;      /* really, bytes/tick.  */
169
	uint32_t bandwidth;      /* really, bytes/tick.  */
170
	int delay ;         /* really, ticks    */
170
	int delay ;         /* really, ticks    */
171
171
172
	struct  mbuf *head, *tail ; /* packets in delay line */
172
	struct  mbuf *head, *tail ; /* packets in delay line */
Lines 232-238 struct dn_pipe8 { /* a pipe */ Link Here
232
	SLIST_ENTRY(dn_pipe8)    next;   /* linked list in a hash slot */
232
	SLIST_ENTRY(dn_pipe8)    next;   /* linked list in a hash slot */
233
233
234
	int pipe_nr ;       /* number   */
234
	int pipe_nr ;       /* number   */
235
	int bandwidth;      /* really, bytes/tick.  */
235
	uint32_t bandwidth;      /* really, bytes/tick.  */
236
	int delay ;         /* really, ticks    */
236
	int delay ;         /* really, ticks    */
237
237
238
	struct  mbuf *head, *tail ; /* packets in delay line */
238
	struct  mbuf *head, *tail ; /* packets in delay line */
(-)sys/netpfil/ipfw/ip_dn_io.c (-1 / +2 lines)
Lines 604-610 serve_sched(struct mq *q, struct dn_sch_ Link Here
604
	struct dn_schk *s = si->sched;
604
	struct dn_schk *s = si->sched;
605
	struct mbuf *m = NULL;
605
	struct mbuf *m = NULL;
606
	int delay_line_idle = (si->dline.mq.head == NULL);
606
	int delay_line_idle = (si->dline.mq.head == NULL);
607
	int done, bw;
607
	int done;
608
	uint32_t bw;
608
609
609
	if (q == NULL) {
610
	if (q == NULL) {
610
		q = &def_q;
611
		q = &def_q;

Return to bug 194453