netgraph-remove-xLEN3.patch

nant, 06/04/2007 12:37 AM

Download (8.9 KB)

View differences:

libexec/pppoed/pppoed.c 2007-06-04 01:02:18.000000000 +0100
498 498
int
499 499
main(int argc, char *argv[])
500 500
{
501
  char hostname[MAXHOSTNAMELEN], *exec, rhook[NG_HOOKLEN + 1];
501
  char hostname[MAXHOSTNAMELEN], *exec, rhook[NG_HOOKSIZ];
502 502
  unsigned char response[1024];
503 503
  const char *label, *prog, *provider, *acname;
504 504
  struct ngm_connect ngc;
505
-- share/examples/netgraph/ngctl.orig	2007-06-04 01:02:35.000000000 +0100
505
++ share/examples/netgraph/ngctl	2007-06-04 01:03:34.000000000 +0100
......
151 151
#
152 152
#     /* Structure used for NGM_LISTHOOKS */
153 153
#     struct linkinfo {
154
#             char            ourhook[NG_HOOKLEN + 1];        /* hook name */
155
#             char            peerhook[NG_HOOKLEN + 1];       /* peer hook */
154
#             char            ourhook[NG_HOOKSIZ];	/* hook name */
155
#             char            peerhook[NG_HOOSIZ];	/* peer hook */
156 156
#             struct nodeinfo nodeinfo;
157 157
#     };
158 158
#
159
-- share/man/man4/netgraph.4.orig	2007-06-04 01:03:49.000000000 +0100
159
++ share/man/man4/netgraph.4	2007-06-04 01:05:10.000000000 +0100
......
103 103
or
104 104
.Dq \&:
105 105
and is limited to
106
.Dv "NG_NODELEN + 1"
106
.Dv "NG_NODESIZ"
107 107
characters (including NUL byte).
108 108
.Pp
109 109
Each node instance has a unique
......
133 133
.Dq \&:
134 134
and is
135 135
limited to
136
.Dv "NG_HOOKLEN + 1"
136
.Dv "NG_HOOKSIZ"
137 137
characters (including NUL byte).
138 138
.It
139 139
A hook is always connected to another hook. That is, hooks are
......
541 541
.Pp
542 542
Control messages have the following structure:
543 543
.Bd -literal
544
#define NG_CMDSTRLEN    15      /* Max command string (16 with null) */
544
#define NG_CMDSTRSIZ    16      /* Max command string (including null) */
545 545

  
546 546
struct ng_mesg {
547 547
  struct ng_msghdr {
......
552 552
    u_long      token;          /* Reply should have the same token */
553 553
    u_long      typecookie;     /* Node type understanding this message */
554 554
    u_long      cmd;            /* Command identifier */
555
    u_char      cmdstr[NG_CMDSTRLEN+1]; /* Cmd string (for debug) */
555
    u_char      cmdstr[NG_CMDSTRSIZ]; /* Cmd string (for debug) */
556 556
  } header;
557 557
  char  data[0];                /* Start of cmd/resp data */
558 558
};
559
-- share/man/man4/ng_bpf.4.orig	2007-06-04 01:05:49.000000000 +0100
559
++ share/man/man4/ng_bpf.4	2007-06-04 01:06:51.000000000 +0100
......
83 83
data on a hook.  The following structure must be supplied as an argument:
84 84
.Bd -literal -offset 4n
85 85
struct ng_bpf_hookprog {
86
  char            thisHook[NG_HOOKLEN+1];   /* name of hook */
87
  char            ifMatch[NG_HOOKLEN+1];    /* match dest hook */
88
  char            ifNotMatch[NG_HOOKLEN+1]; /* !match dest hook */
86
  char            thisHook[NG_HOOKSIZ];   /* name of hook */
87
  char            ifMatch[NG_HOOKSIZ];    /* match dest hook */
88
  char            ifNotMatch[NG_HOOKSIZ]; /* !match dest hook */
89 89
  int32_t         bpf_prog_len;             /* #isns in program */
90 90
  struct bpf_insn bpf_prog[0];              /* bpf program */
91 91
};
92
-- share/man/man4/ng_etf.4.orig	2007-06-04 01:07:09.000000000 +0100
92
++ share/man/man4/ng_etf.4	2007-06-04 01:07:36.000000000 +0100
......
101 101
.Vt "struct ng_etffilter" :
102 102
.Bd -literal -offset 4n
103 103
struct ng_etffilter {
104
        char       matchhook[NG_HOOKLEN + 1]; /* hook name */
104
        char       matchhook[NG_HOOKSIZ];     /* hook name */
105 105
        u_int16_t  ethertype;	              /* catch these */
106 106
};
107 107
.Ed
108
-- share/man/man4/ng_pppoe.4.orig	2007-06-04 01:08:06.000000000 +0100
108
++ share/man/man4/ng_pppoe.4	2007-06-04 01:08:56.000000000 +0100
......
127 127
The three commands above use a common data structure:
128 128
.Bd -literal -offset 4n
129 129
struct ngpppoe_init_data {
130
    char       hook[NG_HOOKLEN + 1];   /* hook to monitor on */
130
    char       hook[NG_HOOKSIZ];       /* hook to monitor on */
131 131
    u_int16_t  data_len;               /* service name length */
132 132
    char       data[0];                /* init data goes here */
133 133
};
......
155 155
The three commands above use a common data structure:
156 156
.Bd -literal -offset 4n
157 157
struct ngpppoe_sts {
158
    char    hook[NG_HOOKLEN + 1]; /* hook associated with event session */
158
    char    hook[NG_HOOKSIZ]; /* hook associated with event session */
159 159
};
160 160
.Ed
161 161
.El
......
226 226
	}               message;
227 227
	/********tracking our little graph ********/
228 228
	char            path[100];
229
	char            source_ID[NG_NODELEN + 1];
229
	char            source_ID[NG_NODESIZ];
230 230
	char            pppoe_node_name[100];
231 231
	int             k;
232 232

  
233
-- sys/dev/misc/musycc/musycc.c.orig	2007-06-04 01:09:25.000000000 +0100
233
++ sys/dev/misc/musycc/musycc.c	2007-06-04 01:09:44.000000000 +0100
......
223 223
	struct mdesc *mdt[NHDLC];
224 224
	struct mdesc *mdr[NHDLC];
225 225
	node_p node;			/* NG node */
226
	char nodename[NG_NODELEN + 1];	/* NG nodename */
226
	char nodename[NG_NODESIZ];	/* NG nodename */
227 227
	struct schan *chan[NHDLC];
228 228
	u_long		cnt_ferr;
229 229
	u_long		cnt_cerr;
230
-- sys/net/i4b/driver/i4b_ing.c.orig	2007-06-04 01:10:02.000000000 +0100
230
++ sys/net/i4b/driver/i4b_ing.c	2007-06-04 01:10:30.000000000 +0100
......
103 103
	struct ifqueue  xmitq;	  /* transmit queue */
104 104
		
105 105
	node_p		node;		/* back pointer to node */
106
	char		nodename[NG_NODELEN + 1]; /* store our node name */
106
	char		nodename[NG_NODESIZ]; /* store our node name */
107 107
	hook_p  	debughook;
108 108
	hook_p  	hook;	
109 109

  
110
-- usr.sbin/ngctl/list.c.orig	2007-06-04 01:11:10.000000000 +0100
110
++ usr.sbin/ngctl/list.c	2007-06-04 01:11:25.000000000 +0100
......
100 100
	printf("There are %d total %snodes:\n",
101 101
	    nlist->numnames, named_only ? "named " : "");
102 102
	for (k = 0; k < nlist->numnames; k++) {
103
		char	path[NG_PATHLEN+1];
103
		char	path[NG_PATHSIZ];
104 104
		const char *new_av[3] = { "list", "-n", path };
105 105

  
106 106
		snprintf(path, sizeof(path),
107
-- usr.sbin/ngctl/main.c.orig	2007-06-04 01:11:37.000000000 +0100
107
++ usr.sbin/ngctl/main.c	2007-06-04 01:12:01.000000000 +0100
......
110 110
int
111 111
main(int ac, char *av[])
112 112
{
113
	char	name[NG_NODELEN + 1];
113
	char	name[NG_NODESIZ];
114 114
	int	interactive = isatty(0) && isatty(1);
115 115
	FILE	*fp = NULL;
116 116
	int	ch, rtn = 0;
......
236 236
		/* Display any incoming data packet */
237 237
		if (FD_ISSET(dsock, &rfds)) {
238 238
			u_char buf[8192];
239
			char hook[NG_HOOKLEN + 1];
239
			char hook[NG_HOOKSIZ];
240 240
			int rl;
241 241

  
242 242
			/* Read packet from socket */
243
-- usr.sbin/ngctl/msg.c.orig	2007-06-04 01:12:13.000000000 +0100
243
++ usr.sbin/ngctl/msg.c	2007-06-04 01:12:36.000000000 +0100
......
112 112
	u_char buf[2 * sizeof(struct ng_mesg) + BUF_SIZE];
113 113
	struct ng_mesg *const m = (struct ng_mesg *)buf;
114 114
	struct ng_mesg *const ascii = (struct ng_mesg *)m->data;
115
	char path[NG_PATHLEN+1];
115
	char path[NG_PATHSIZ];
116 116

  
117 117
	/* Get incoming message (in binary form) */
118 118
	if (NgRecvMsg(csock, m, sizeof(buf), path) < 0) {
119
-- usr.sbin/ppp/netgraph.c.orig	2007-06-04 01:12:50.000000000 +0100
119
++ usr.sbin/ppp/netgraph.c	2007-06-04 01:14:23.000000000 +0100
......
92 92
struct ngdevice {
93 93
  struct device dev;			/* What struct physical knows about */
94 94
  int cs;				/* Control socket */
95
  char hook[NG_HOOKLEN + 1];		/* Our socket node hook */
95
  char hook[NG_HOOKSIZ];		/* Our socket node hook */
96 96
};
97 97

  
98 98
#define device2ng(d)	((d)->type == NG_DEVICE ? (struct ngdevice *)d : NULL)
......
108 108
static int
109 109
ng_MessageOut(struct ngdevice *dev, struct physical *p, const char *data)
110 110
{
111
  char path[NG_PATHLEN + 1];
111
  char path[NG_PATHSIZ];
112 112
  int len, pos, dpos;
113 113
  char *fmt;
114 114

  
......
169 169
  char msgbuf[sizeof(struct ng_mesg) * 2 + NG_MSGBUFSZ];
170 170
  struct ngdevice *dev = device2ng(p->handler);
171 171
  struct ng_mesg *rep = (struct ng_mesg *)msgbuf;
172
  char path[NG_PATHLEN + 1];
172
  char path[NG_PATHSIZ];
173 173
  int len;
174 174

  
175 175
#ifdef BROKEN_SELECT
......
233 233
static ssize_t
234 234
ng_Read(struct physical *p, void *v, size_t n)
235 235
{
236
  char hook[NG_HOOKLEN + 1];
236
  char hook[NG_HOOKSIZ];
237 237

  
238 238
log_Printf(LogDEBUG, "ng_Read\n");
239 239
  switch (p->dl->state) {
......
463 463
  struct ngm_mkpeer mkp;
464 464
  struct ngm_connect ngc;
465 465
  const char *devp, *endp;
466
  char lasthook[NG_HOOKLEN + 1];
467
  char hook[NG_HOOKLEN + 1];
468
  char nodetype[NG_TYPELEN + NG_NODELEN + 2];
469
  char modname[NG_TYPELEN + 4];
470
  char path[NG_PATHLEN + 1];
466
  char lasthook[NG_HOOKSIZ];
467
  char hook[NG_HOOKSIZ];
468
  char nodetype[NG_TYPESIZ + NG_NODESIZ];
469
  char modname[NG_TYPESIZ + 3];
470
  char path[NG_PATHSIZ];
471 471
  char *nodename;
472 472
  int len, sz, done, f;
473 473

  
474
-- usr.sbin/ppp/tty.c.orig	2007-06-04 01:14:45.000000000 +0100
474
++ usr.sbin/ppp/tty.c	2007-06-04 01:15:04.000000000 +0100
......
228 228
tty_SetAsyncParams(struct physical *p, u_int32_t mymap, u_int32_t hismap)
229 229
{
230 230
  struct ttydevice *dev = device2tty(p->handler);
231
  char asyncpath[NG_PATHLEN + 1];
231
  char asyncpath[NG_PATHSIZ];
232 232
  struct ng_async_cfg cfg;
233 233

  
234 234
  if (isngtty(dev)) {
......
257 257
  u_char rbuf[sizeof(struct ng_mesg) + sizeof(struct nodeinfo)];
258 258
  struct ng_mesg *reply;
259 259
  struct nodeinfo *info;
260
  char ttypath[NG_NODELEN + 1];
260
  char ttypath[NG_NODESIZ];
261 261
  struct ngm_mkpeer ngm;
262 262
  struct ngm_connect ngc;
263 263
  int ldisc, cs, ds, hot, speed;