Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 275112 | Differences between
and this patch

Collapse All | Expand All

(-)src/bund.c (-2 / +2 lines)
Lines 1546-1552 Link Here
1546
void
1546
void
1547
BundNgShutdown(Bund b, int iface, int ppp)
1547
BundNgShutdown(Bund b, int iface, int ppp)
1548
{
1548
{
1549
  char	path[NG_PATHLEN + 1];
1549
  char	path[NG_PATHSIZ];
1550
1550
1551
  if (iface) {
1551
  if (iface) {
1552
    snprintf(path, sizeof(path), "%s:", b->iface.ifname);
1552
    snprintf(path, sizeof(path), "%s:", b->iface.ifname);
Lines 1717-1723 Link Here
1717
      u_char		buf[8192];
1717
      u_char		buf[8192];
1718
      struct ng_mesg	msg;
1718
      struct ng_mesg	msg;
1719
  }			u;
1719
  }			u;
1720
  char			raddr[NG_PATHLEN + 1];
1720
  char			raddr[NG_PATHSIZ];
1721
  int			len;
1721
  int			len;
1722
1722
1723
  /* Read message */
1723
  /* Read message */
(-)src/ccp_deflate.c (-5 / +5 lines)
Lines 71-77 Link Here
71
  DeflateInfo		const deflate = &b->ccp.deflate;
71
  DeflateInfo		const deflate = &b->ccp.deflate;
72
  struct ng_deflate_config	conf;
72
  struct ng_deflate_config	conf;
73
  struct ngm_mkpeer	mp;
73
  struct ngm_mkpeer	mp;
74
  char			path[NG_PATHLEN + 1];
74
  char			path[NG_PATHSIZ];
75
  const char		*deflatehook, *ppphook;
75
  const char		*deflatehook, *ppphook;
76
  int			cmd;
76
  int			cmd;
77
77
Lines 165-171 Link Here
165
DeflateCleanup(Bund b, int dir)
165
DeflateCleanup(Bund b, int dir)
166
{
166
{
167
  const char	*ppphook;
167
  const char	*ppphook;
168
  char		path[NG_PATHLEN + 1];
168
  char		path[NG_PATHSIZ];
169
169
170
  /* Remove node */
170
  /* Remove node */
171
  switch (dir) {
171
  switch (dir) {
Lines 190-196 Link Here
190
static Mbuf
190
static Mbuf
191
DeflateRecvResetReq(Bund b, int id, Mbuf bp, int *noAck)
191
DeflateRecvResetReq(Bund b, int id, Mbuf bp, int *noAck)
192
{
192
{
193
  char	path[NG_PATHLEN + 1];
193
  char	path[NG_PATHSIZ];
194
194
195
  /* Forward ResetReq to the DEFLATE compression node */
195
  /* Forward ResetReq to the DEFLATE compression node */
196
  snprintf(path, sizeof(path), "%s.%s", MPD_HOOK_PPP, NG_PPP_HOOK_COMPRESS);
196
  snprintf(path, sizeof(path), "%s.%s", MPD_HOOK_PPP, NG_PPP_HOOK_COMPRESS);
Lines 219-225 Link Here
219
static void
219
static void
220
DeflateRecvResetAck(Bund b, int id, Mbuf bp)
220
DeflateRecvResetAck(Bund b, int id, Mbuf bp)
221
{
221
{
222
  char	path[NG_PATHLEN + 1];
222
  char	path[NG_PATHSIZ];
223
223
224
  /* Forward ResetReq to the DEFLATE compression node */
224
  /* Forward ResetReq to the DEFLATE compression node */
225
  snprintf(path, sizeof(path), "%s.%s", MPD_HOOK_PPP, NG_PPP_HOOK_DECOMPRESS);
225
  snprintf(path, sizeof(path), "%s.%s", MPD_HOOK_PPP, NG_PPP_HOOK_DECOMPRESS);
Lines 328-334 Link Here
328
DeflateStat(Context ctx, int dir) 
328
DeflateStat(Context ctx, int dir) 
329
{
329
{
330
    Bund			b = ctx->bund;
330
    Bund			b = ctx->bund;
331
    char			path[NG_PATHLEN + 1];
331
    char			path[NG_PATHSIZ];
332
    struct ng_deflate_stats	stats;
332
    struct ng_deflate_stats	stats;
333
    union {
333
    union {
334
	u_char			buf[sizeof(struct ng_mesg) + sizeof(stats)];
334
	u_char			buf[sizeof(struct ng_mesg) + sizeof(stats)];
(-)src/ccp_mppc.c (-3 / +3 lines)
Lines 91-97 Link Here
91
  MppcInfo		const mppc = &b->ccp.mppc;
91
  MppcInfo		const mppc = &b->ccp.mppc;
92
  struct ng_mppc_config	conf;
92
  struct ng_mppc_config	conf;
93
  struct ngm_mkpeer	mp;
93
  struct ngm_mkpeer	mp;
94
  char			path[NG_PATHLEN + 1];
94
  char			path[NG_PATHSIZ];
95
  const char		*mppchook, *ppphook;
95
  const char		*mppchook, *ppphook;
96
  int			mschap;
96
  int			mschap;
97
  int			cmd;
97
  int			cmd;
Lines 240-246 Link Here
240
MppcCleanup(Bund b, int dir)
240
MppcCleanup(Bund b, int dir)
241
{
241
{
242
  const char	*ppphook;
242
  const char	*ppphook;
243
  char		path[NG_PATHLEN + 1];
243
  char		path[NG_PATHSIZ];
244
244
245
  /* Remove node */
245
  /* Remove node */
246
  switch (dir) {
246
  switch (dir) {
Lines 421-427 Link Here
421
static Mbuf
421
static Mbuf
422
MppcRecvResetReq(Bund b, int id, Mbuf bp, int *noAck)
422
MppcRecvResetReq(Bund b, int id, Mbuf bp, int *noAck)
423
{
423
{
424
  char	path[NG_PATHLEN + 1];
424
  char	path[NG_PATHSIZ];
425
425
426
  /* Forward ResetReq to the MPPC compression node */
426
  /* Forward ResetReq to the MPPC compression node */
427
  snprintf(path, sizeof(path), "%s.%s", MPD_HOOK_PPP, NG_PPP_HOOK_COMPRESS);
427
  snprintf(path, sizeof(path), "%s.%s", MPD_HOOK_PPP, NG_PPP_HOOK_COMPRESS);
(-)src/ccp_pred1.c (-5 / +5 lines)
Lines 134-140 Link Here
134
  struct ngm_mkpeer	mp;
134
  struct ngm_mkpeer	mp;
135
  struct ng_pred1_config conf;
135
  struct ng_pred1_config conf;
136
  const char		*pred1hook, *ppphook;
136
  const char		*pred1hook, *ppphook;
137
  char                  path[NG_PATHLEN + 1];
137
  char                  path[NG_PATHSIZ];
138
138
139
  memset(&conf, 0, sizeof(conf));
139
  memset(&conf, 0, sizeof(conf));
140
  conf.enable = 1;
140
  conf.enable = 1;
Lines 202-208 Link Here
202
  }
202
  }
203
#else
203
#else
204
  const char	*ppphook;
204
  const char	*ppphook;
205
  char		path[NG_PATHLEN + 1];
205
  char		path[NG_PATHSIZ];
206
206
207
  /* Remove node */
207
  /* Remove node */
208
  switch (dir) {
208
  switch (dir) {
Lines 398-404 Link Here
398
  Pred1Init(b, COMP_DIR_XMIT);
398
  Pred1Init(b, COMP_DIR_XMIT);
399
  p->xmit_stats.Errors++;
399
  p->xmit_stats.Errors++;
400
#else
400
#else
401
  char	path[NG_PATHLEN + 1];
401
  char	path[NG_PATHSIZ];
402
  /* Forward ResetReq to the DEFLATE compression node */
402
  /* Forward ResetReq to the DEFLATE compression node */
403
  snprintf(path, sizeof(path), "%s.%s", MPD_HOOK_PPP, NG_PPP_HOOK_COMPRESS);
403
  snprintf(path, sizeof(path), "%s.%s", MPD_HOOK_PPP, NG_PPP_HOOK_COMPRESS);
404
  if (NgSendMsg(b->csock, path,
404
  if (NgSendMsg(b->csock, path,
Lines 433-439 Link Here
433
#ifndef USE_NG_PRED1
433
#ifndef USE_NG_PRED1
434
  Pred1Init(b, COMP_DIR_RECV);
434
  Pred1Init(b, COMP_DIR_RECV);
435
#else
435
#else
436
  char	path[NG_PATHLEN + 1];
436
  char	path[NG_PATHSIZ];
437
  /* Forward ResetReq to the DEFLATE compression node */
437
  /* Forward ResetReq to the DEFLATE compression node */
438
  snprintf(path, sizeof(path), "%s.%s", MPD_HOOK_PPP, NG_PPP_HOOK_DECOMPRESS);
438
  snprintf(path, sizeof(path), "%s.%s", MPD_HOOK_PPP, NG_PPP_HOOK_DECOMPRESS);
439
  if (NgSendMsg(b->csock, path,
439
  if (NgSendMsg(b->csock, path,
Lines 537-543 Link Here
537
    return (0);
537
    return (0);
538
#else
538
#else
539
    Bund			b = ctx->bund;
539
    Bund			b = ctx->bund;
540
    char			path[NG_PATHLEN + 1];
540
    char			path[NG_PATHSIZ];
541
    struct ng_pred1_stats	stats;
541
    struct ng_pred1_stats	stats;
542
    union {
542
    union {
543
	u_char			buf[sizeof(struct ng_mesg) + sizeof(stats)];
543
	u_char			buf[sizeof(struct ng_mesg) + sizeof(stats)];
(-)src/iface.c (-41 / +41 lines)
Lines 1697-1704 Link Here
1697
IfaceNgIpInit(Bund b, int ready)
1697
IfaceNgIpInit(Bund b, int ready)
1698
{
1698
{
1699
    struct ngm_connect	cn;
1699
    struct ngm_connect	cn;
1700
    char		path[NG_PATHLEN + 1];
1700
    char		path[NG_PATHSIZ];
1701
    char		hook[NG_HOOKLEN + 1];
1701
    char		hook[NG_HOOKSIZ];
1702
1702
1703
    if (!ready) {
1703
    if (!ready) {
1704
	/* Dial-on-Demand mode */
1704
	/* Dial-on-Demand mode */
Lines 1802-1808 Link Here
1802
static void
1802
static void
1803
IfaceNgIpShutdown(Bund b)
1803
IfaceNgIpShutdown(Bund b)
1804
{
1804
{
1805
    char		path[NG_PATHLEN + 1];
1805
    char		path[NG_PATHSIZ];
1806
1806
1807
#ifdef USE_NG_NAT
1807
#ifdef USE_NG_NAT
1808
    if (b->iface.nat_up)
1808
    if (b->iface.nat_up)
Lines 1840-1846 Link Here
1840
IfaceNgIpv6Init(Bund b, int ready)
1840
IfaceNgIpv6Init(Bund b, int ready)
1841
{
1841
{
1842
    struct ngm_connect	cn;
1842
    struct ngm_connect	cn;
1843
    char		path[NG_PATHLEN + 1];
1843
    char		path[NG_PATHSIZ];
1844
1844
1845
    if (!ready) {
1845
    if (!ready) {
1846
    } else {
1846
    } else {
Lines 1871-1877 Link Here
1871
static void
1871
static void
1872
IfaceNgIpv6Shutdown(Bund b)
1872
IfaceNgIpv6Shutdown(Bund b)
1873
{
1873
{
1874
    char		path[NG_PATHLEN + 1];
1874
    char		path[NG_PATHSIZ];
1875
1875
1876
    NgFuncDisconnect(b->csock, b->name, MPD_HOOK_PPP, NG_PPP_HOOK_IPV6);
1876
    NgFuncDisconnect(b->csock, b->name, MPD_HOOK_PPP, NG_PPP_HOOK_IPV6);
1877
1877
Lines 1901-1908 Link Here
1901
	b->name, NG_NAT_NODE_TYPE, path, mp.ourhook, strerror(errno)));
1901
	b->name, NG_NAT_NODE_TYPE, path, mp.ourhook, strerror(errno)));
1902
      return(-1);
1902
      return(-1);
1903
    }
1903
    }
1904
    strlcat(path, ".", NG_PATHLEN);
1904
    strlcat(path, ".", NG_PATHSIZ - 1);
1905
    strlcat(path, hook, NG_PATHLEN);
1905
    strlcat(path, hook, NG_PATHSIZ - 1);
1906
    snprintf(nm.name, sizeof(nm.name), "mpd%d-%s-nat", gPid, b->name);
1906
    snprintf(nm.name, sizeof(nm.name), "mpd%d-%s-nat", gPid, b->name);
1907
    if (NgSendMsg(b->csock, path,
1907
    if (NgSendMsg(b->csock, path,
1908
	NGM_GENERIC_COOKIE, NGM_NAME, &nm, sizeof(nm)) < 0) {
1908
	NGM_GENERIC_COOKIE, NGM_NAME, &nm, sizeof(nm)) < 0) {
Lines 1962-1968 Link Here
1962
IfaceSetupNAT(Bund b)
1962
IfaceSetupNAT(Bund b)
1963
{
1963
{
1964
    NatState	const nat = &b->iface.nat;
1964
    NatState	const nat = &b->iface.nat;
1965
    char	path[NG_PATHLEN+1];
1965
    char	path[NG_PATHSIZ];
1966
1966
1967
    if (u_addrempty(&nat->alias_addr)) {
1967
    if (u_addrempty(&nat->alias_addr)) {
1968
	snprintf(path, sizeof(path), "mpd%d-%s-nat:", gPid, b->name);
1968
	snprintf(path, sizeof(path), "mpd%d-%s-nat:", gPid, b->name);
Lines 1981-1987 Link Here
1981
static void
1981
static void
1982
IfaceShutdownNAT(Bund b)
1982
IfaceShutdownNAT(Bund b)
1983
{
1983
{
1984
    char	path[NG_PATHLEN+1];
1984
    char	path[NG_PATHSIZ];
1985
1985
1986
    snprintf(path, sizeof(path), "mpd%d-%s-nat:", gPid, b->name);
1986
    snprintf(path, sizeof(path), "mpd%d-%s-nat:", gPid, b->name);
1987
    NgFuncShutdownNode(b->csock, b->name, path);
1987
    NgFuncShutdownNode(b->csock, b->name, path);
Lines 2005-2012 Link Here
2005
	b->name, NG_TEE_NODE_TYPE, path, mp.ourhook, strerror(errno)));
2005
	b->name, NG_TEE_NODE_TYPE, path, mp.ourhook, strerror(errno)));
2006
      return(-1);
2006
      return(-1);
2007
    }
2007
    }
2008
    strlcat(path, ".", NG_PATHLEN);
2008
    strlcat(path, ".", NG_PATHSIZ - 1);
2009
    strlcat(path, hook, NG_PATHLEN);
2009
    strlcat(path, hook, NG_PATHSIZ - 1);
2010
    snprintf(nm.name, sizeof(nm.name), "%s-tee", b->iface.ifname);
2010
    snprintf(nm.name, sizeof(nm.name), "%s-tee", b->iface.ifname);
2011
    if (NgSendMsg(b->csock, path,
2011
    if (NgSendMsg(b->csock, path,
2012
	NGM_GENERIC_COOKIE, NGM_NAME, &nm, sizeof(nm)) < 0) {
2012
	NGM_GENERIC_COOKIE, NGM_NAME, &nm, sizeof(nm)) < 0) {
Lines 2022-2028 Link Here
2022
static void
2022
static void
2023
IfaceShutdownTee(Bund b)
2023
IfaceShutdownTee(Bund b)
2024
{
2024
{
2025
    char	path[NG_PATHLEN+1];
2025
    char	path[NG_PATHSIZ];
2026
2026
2027
    snprintf(path, sizeof(path), "%s-tee:", b->iface.ifname);
2027
    snprintf(path, sizeof(path), "%s-tee:", b->iface.ifname);
2028
    NgFuncShutdownNode(b->csock, b->name, path);
2028
    NgFuncShutdownNode(b->csock, b->name, path);
Lines 2035-2041 Link Here
2035
    struct ngm_mkpeer	mp;
2035
    struct ngm_mkpeer	mp;
2036
    struct ngm_name	nm;
2036
    struct ngm_name	nm;
2037
    struct ngm_connect  cn;
2037
    struct ngm_connect  cn;
2038
    char		path1[NG_PATHLEN+1];
2038
    char		path1[NG_PATHSIZ];
2039
    struct {
2039
    struct {
2040
	struct ng_ipacct_mesg m;
2040
	struct ng_ipacct_mesg m;
2041
	int		data;
2041
	int		data;
Lines 2052-2059 Link Here
2052
	b->name, NG_TEE_NODE_TYPE, path, mp.ourhook, strerror(errno)));
2052
	b->name, NG_TEE_NODE_TYPE, path, mp.ourhook, strerror(errno)));
2053
      return(-1);
2053
      return(-1);
2054
    }
2054
    }
2055
    strlcat(path, ".", NG_PATHLEN);
2055
    strlcat(path, ".", NG_PATHSIZ - 1);
2056
    strlcat(path, hook, NG_PATHLEN);
2056
    strlcat(path, hook, NG_PATHSIZ - 1);
2057
    snprintf(nm.name, sizeof(nm.name), "%s_acct_tee", b->iface.ifname);
2057
    snprintf(nm.name, sizeof(nm.name), "%s_acct_tee", b->iface.ifname);
2058
    if (NgSendMsg(b->csock, path,
2058
    if (NgSendMsg(b->csock, path,
2059
	NGM_GENERIC_COOKIE, NGM_NAME, &nm, sizeof(nm)) < 0) {
2059
	NGM_GENERIC_COOKIE, NGM_NAME, &nm, sizeof(nm)) < 0) {
Lines 2128-2134 Link Here
2128
static void
2128
static void
2129
IfaceShutdownIpacct(Bund b)
2129
IfaceShutdownIpacct(Bund b)
2130
{
2130
{
2131
    char	path[NG_PATHLEN+1];
2131
    char	path[NG_PATHSIZ];
2132
2132
2133
    snprintf(path, sizeof(path), "%s_acct_tee:", b->iface.ifname);
2133
    snprintf(path, sizeof(path), "%s_acct_tee:", b->iface.ifname);
2134
    NgFuncShutdownNode(b->csock, b->name, path);
2134
    NgFuncShutdownNode(b->csock, b->name, path);
Lines 2165-2177 Link Here
2165
        b->name, path, cn.ourhook, cn.path, cn.peerhook, strerror(errno)));
2165
        b->name, path, cn.ourhook, cn.path, cn.peerhook, strerror(errno)));
2166
      return (-1);
2166
      return (-1);
2167
    }
2167
    }
2168
    strlcat(path, ".", NG_PATHLEN);
2168
    strlcat(path, ".", NG_PATHSIZ - 1);
2169
    strlcat(path, hook, NG_PATHLEN);
2169
    strlcat(path, hook, NG_PATHSIZ - 1);
2170
    if (out) {
2170
    if (out) {
2171
	snprintf(hook, NG_HOOKLEN, "%s%d", NG_NETFLOW_HOOK_DATA,
2171
	snprintf(hook, NG_HOOKSIZ - 1, "%s%d", NG_NETFLOW_HOOK_DATA,
2172
	    gNetflowIface + b->id*2 + out);
2172
	    gNetflowIface + b->id*2 + out);
2173
    } else {
2173
    } else {
2174
	snprintf(hook, NG_HOOKLEN, "%s%d", NG_NETFLOW_HOOK_OUT,
2174
	snprintf(hook, NG_HOOKSIZ - 1, "%s%d", NG_NETFLOW_HOOK_OUT,
2175
	    gNetflowIface + b->id*2 + out);
2175
	    gNetflowIface + b->id*2 + out);
2176
    }
2176
    }
2177
    return (0);
2177
    return (0);
Lines 2180-2186 Link Here
2180
static int
2180
static int
2181
IfaceSetupNetflow(Bund b, char out)
2181
IfaceSetupNetflow(Bund b, char out)
2182
{
2182
{
2183
    char path[NG_PATHLEN + 1];
2183
    char path[NG_PATHSIZ];
2184
    struct ng_netflow_setdlt	 nf_setdlt;
2184
    struct ng_netflow_setdlt	 nf_setdlt;
2185
    struct ng_netflow_setifindex nf_setidx;
2185
    struct ng_netflow_setifindex nf_setidx;
2186
    
2186
    
Lines 2213-2226 Link Here
2213
static void
2213
static void
2214
IfaceShutdownNetflow(Bund b, char out)
2214
IfaceShutdownNetflow(Bund b, char out)
2215
{
2215
{
2216
    char	path[NG_PATHLEN+1];
2216
    char	path[NG_PATHSIZ];
2217
    char	hook[NG_HOOKLEN+1];
2217
    char	hook[NG_HOOKSIZ];
2218
2218
2219
    snprintf(path, NG_PATHLEN, "%s:", gNetflowNodeName);
2219
    snprintf(path, NG_PATHSIZ - 1, "%s:", gNetflowNodeName);
2220
    snprintf(hook, NG_HOOKLEN, "%s%d", NG_NETFLOW_HOOK_DATA,
2220
    snprintf(hook, NG_HOOKSIZ - 1, "%s%d", NG_NETFLOW_HOOK_DATA,
2221
	    gNetflowIface + b->id*2 + out);
2221
	    gNetflowIface + b->id*2 + out);
2222
    NgFuncDisconnect(b->csock, b->name, path, hook);
2222
    NgFuncDisconnect(b->csock, b->name, path, hook);
2223
    snprintf(hook, NG_HOOKLEN, "%s%d", NG_NETFLOW_HOOK_OUT,
2223
    snprintf(hook, NG_HOOKSIZ - 1, "%s%d", NG_NETFLOW_HOOK_OUT,
2224
	    gNetflowIface + b->id*2 + out);
2224
	    gNetflowIface + b->id*2 + out);
2225
    NgFuncDisconnect(b->csock, b->name, path, hook);
2225
    NgFuncDisconnect(b->csock, b->name, path, hook);
2226
}
2226
}
Lines 2251-2259 Link Here
2251
	    goto fail;
2251
	    goto fail;
2252
	}
2252
	}
2253
2253
2254
	strlcat(path, ".", NG_PATHLEN);
2254
	strlcat(path, ".", NG_PATHSIZ - 1);
2255
	strlcat(path, hook, NG_PATHLEN);
2255
	strlcat(path, hook, NG_PATHSIZ - 1);
2256
	snprintf(hook, NG_HOOKLEN, "out");
2256
	snprintf(hook, NG_HOOKSIZ - 1, "out");
2257
2257
2258
	/* Set the new node's name. */
2258
	/* Set the new node's name. */
2259
	snprintf(nm.name, sizeof(nm.name), "mpd%d-%s-mss", gPid, b->name);
2259
	snprintf(nm.name, sizeof(nm.name), "mpd%d-%s-mss", gPid, b->name);
Lines 2276-2283 Link Here
2276
	goto fail;
2276
	goto fail;
2277
    }
2277
    }
2278
2278
2279
    strlcat(path, ".", NG_PATHLEN);
2279
    strlcat(path, ".", NG_PATHSIZ - 1);
2280
    strlcat(path, hook, NG_PATHLEN);
2280
    strlcat(path, hook, NG_PATHSIZ - 1);
2281
    strcpy(hook, "iface");
2281
    strcpy(hook, "iface");
2282
2282
2283
#if NG_NODESIZ>=32
2283
#if NG_NODESIZ>=32
Lines 2329-2335 Link Here
2329
{
2329
{
2330
#ifdef USE_NG_TCPMSS
2330
#ifdef USE_NG_TCPMSS
2331
  struct	ng_tcpmss_config tcpmsscfg;
2331
  struct	ng_tcpmss_config tcpmsscfg;
2332
  char		path[NG_PATHLEN];
2332
  char		path[NG_PATHSIZ - 1];
2333
2333
2334
  snprintf(path, sizeof(path), "mpd%d-%s-mss:", gPid, b->name);
2334
  snprintf(path, sizeof(path), "mpd%d-%s-mss:", gPid, b->name);
2335
2335
Lines 2422-2428 Link Here
2422
IfaceShutdownMSS(Bund b)
2422
IfaceShutdownMSS(Bund b)
2423
{
2423
{
2424
#ifdef USE_NG_TCPMSS
2424
#ifdef USE_NG_TCPMSS
2425
	char	path[NG_PATHLEN+1];
2425
	char	path[NG_PATHSIZ];
2426
2426
2427
	snprintf(path, sizeof(path), "mpd%d-%s-mss:", gPid, b->name);
2427
	snprintf(path, sizeof(path), "mpd%d-%s-mss:", gPid, b->name);
2428
	NgFuncShutdownNode(b->csock, b->name, path);
2428
	NgFuncShutdownNode(b->csock, b->name, path);
Lines 2454-2461 Link Here
2454
	    goto fail;
2454
	    goto fail;
2455
	}
2455
	}
2456
2456
2457
	strlcat(path, ".", NG_PATHLEN);
2457
	strlcat(path, ".", NG_PATHSIZ - 1);
2458
	strlcat(path, hook, NG_PATHLEN);
2458
	strlcat(path, hook, NG_PATHSIZ - 1);
2459
	strcpy(hook, "iface");
2459
	strcpy(hook, "iface");
2460
2460
2461
#if NG_NODESIZ>=32
2461
#if NG_NODESIZ>=32
Lines 2494-2503 Link Here
2494
    
2494
    
2495
    struct ngm_connect  cn;
2495
    struct ngm_connect  cn;
2496
    
2496
    
2497
    char		path[NG_PATHLEN + 1];
2497
    char		path[NG_PATHSIZ];
2498
    char		inhook[2][NG_HOOKLEN+1];
2498
    char		inhook[2][NG_HOOKSIZ];
2499
    char		inhookn[2][NG_HOOKLEN+1];
2499
    char		inhookn[2][NG_HOOKSIZ];
2500
    char		outhook[NG_HOOKLEN+1];
2500
    char		outhook[NG_HOOKSIZ];
2501
    struct acl		*l;
2501
    struct acl		*l;
2502
    char		str[ACL_LEN];
2502
    char		str[ACL_LEN];
2503
#define	ACL_MAX_PARAMS	5
2503
#define	ACL_MAX_PARAMS	5
Lines 2636-2642 Link Here
2636
			       (strcasecmp(av[p], "rate-limit") == 0)) {
2636
			       (strcasecmp(av[p], "rate-limit") == 0)) {
2637
			struct ngm_mkpeer mp;
2637
			struct ngm_mkpeer mp;
2638
			struct ng_car_bulkconf car;
2638
			struct ng_car_bulkconf car;
2639
			char		tmppath[NG_PATHLEN + 1];
2639
			char		tmppath[NG_PATHSIZ];
2640
2640
2641
			union {
2641
			union {
2642
			    u_char	buf[NG_BPF_HOOKPROG_SIZE(ACL_MAX_PROGLEN)];
2642
			    u_char	buf[NG_BPF_HOOKPROG_SIZE(ACL_MAX_PROGLEN)];
Lines 2784-2790 Link Here
2784
static void
2784
static void
2785
IfaceShutdownLimits(Bund b)
2785
IfaceShutdownLimits(Bund b)
2786
{
2786
{
2787
    char path[NG_PATHLEN + 1];
2787
    char path[NG_PATHSIZ];
2788
2788
2789
    if (b->params.acl_limits[0] || b->params.acl_limits[1]) {
2789
    if (b->params.acl_limits[0] || b->params.acl_limits[1]) {
2790
	snprintf(path, sizeof(path), "mpd%d-%s-lim:", gPid, b->name);
2790
	snprintf(path, sizeof(path), "mpd%d-%s-lim:", gPid, b->name);
(-)src/ipcp.c (-4 / +4 lines)
Lines 176-182 Link Here
176
int
176
int
177
IpcpStat(Context ctx, int ac, char *av[], void *arg)
177
IpcpStat(Context ctx, int ac, char *av[], void *arg)
178
{
178
{
179
  char			path[NG_PATHLEN + 1];
179
  char			path[NG_PATHSIZ];
180
  IpcpState		const ipcp = &ctx->bund->ipcp;
180
  IpcpState		const ipcp = &ctx->bund->ipcp;
181
  Fsm			fp = &ipcp->fsm;
181
  Fsm			fp = &ipcp->fsm;
182
  union {
182
  union {
Lines 396-402 Link Here
396
    Bund 	b = (Bund)fp->arg;
396
    Bund 	b = (Bund)fp->arg;
397
  IpcpState		const ipcp = &b->ipcp;
397
  IpcpState		const ipcp = &b->ipcp;
398
  char			ipbuf[20];
398
  char			ipbuf[20];
399
  char			path[NG_PATHLEN + 1];
399
  char			path[NG_PATHSIZ];
400
  struct ngm_vjc_config	vjc;
400
  struct ngm_vjc_config	vjc;
401
  struct u_addr		tmp;
401
  struct u_addr		tmp;
402
402
Lines 765-771 Link Here
765
  struct ngm_mkpeer	mp;
765
  struct ngm_mkpeer	mp;
766
  struct ngm_connect	cn;
766
  struct ngm_connect	cn;
767
#if NG_NODESIZ>=32
767
#if NG_NODESIZ>=32
768
  char path[NG_PATHLEN + 1];
768
  char path[NG_PATHSIZ];
769
  struct ngm_name	nm;
769
  struct ngm_name	nm;
770
#endif
770
#endif
771
771
Lines 827-833 Link Here
827
static void
827
static void
828
IpcpNgShutdownVJ(Bund b)
828
IpcpNgShutdownVJ(Bund b)
829
{
829
{
830
    char	path[NG_PATHLEN+1];
830
    char	path[NG_PATHSIZ];
831
831
832
    snprintf(path, sizeof(path), ".:%s.%s", MPD_HOOK_PPP, NG_PPP_HOOK_VJC_IP);
832
    snprintf(path, sizeof(path), ".:%s.%s", MPD_HOOK_PPP, NG_PPP_HOOK_VJC_IP);
833
    NgFuncShutdownNode(b->csock, b->name, path);
833
    NgFuncShutdownNode(b->csock, b->name, path);
(-)src/l2tp.c (-4 / +4 lines)
Lines 282-288 Link Here
282
	struct ngm_mkpeer mkpeer;
282
	struct ngm_mkpeer mkpeer;
283
	struct sockaddr_storage peer_sas;
283
	struct sockaddr_storage peer_sas;
284
	struct sockaddr_storage sas;
284
	struct sockaddr_storage sas;
285
	char hook[NG_HOOKLEN + 1];
285
	char hook[NG_HOOKSIZ];
286
	char namebuf[64];
286
	char namebuf[64];
287
	char hostname[MAXHOSTNAMELEN];
287
	char hostname[MAXHOSTNAMELEN];
288
	ng_ID_t node_id;
288
	ng_ID_t node_id;
Lines 646-652 Link Here
646
    L2tpInfo	const pi = (L2tpInfo) p->info;
646
    L2tpInfo	const pi = (L2tpInfo) p->info;
647
    const char	*hook;
647
    const char	*hook;
648
    ng_ID_t	node_id;
648
    ng_ID_t	node_id;
649
    char	path[NG_PATHLEN + 1];
649
    char	path[NG_PATHSIZ];
650
	
650
	
651
    if (pi->sess) {		/* avoid double close */
651
    if (pi->sess) {		/* avoid double close */
652
652
Lines 1167-1173 Link Here
1167
	L2tpInfo	pi = (L2tpInfo)p->info;
1167
	L2tpInfo	pi = (L2tpInfo)p->info;
1168
        const char 	*hook;
1168
        const char 	*hook;
1169
        ng_ID_t		node_id;
1169
        ng_ID_t		node_id;
1170
	char		path[NG_PATHLEN + 1];
1170
	char		path[NG_PATHSIZ];
1171
	struct ngm_connect      cn;
1171
	struct ngm_connect      cn;
1172
1172
1173
	/* Get a temporary netgraph socket node */
1173
	/* Get a temporary netgraph socket node */
Lines 1227-1233 Link Here
1227
	struct sockaddr_storage sas;
1227
	struct sockaddr_storage sas;
1228
	const size_t bufsize = 8192;
1228
	const size_t bufsize = 8192;
1229
	u_int16_t *buf = NULL;
1229
	u_int16_t *buf = NULL;
1230
	char hook[NG_HOOKLEN + 1];
1230
	char hook[NG_HOOKSIZ];
1231
	char hostname[MAXHOSTNAMELEN];
1231
	char hostname[MAXHOSTNAMELEN];
1232
	socklen_t sas_len;
1232
	socklen_t sas_len;
1233
	char namebuf[64];
1233
	char namebuf[64];
(-)src/l2tp_ctrl.c (-3 / +3 lines)
Lines 206-212 Link Here
206
	u_int16_t		session_id;		/* session id */
206
	u_int16_t		session_id;		/* session id */
207
	u_int16_t		peer_id;		/* peer session id */
207
	u_int16_t		peer_id;		/* peer session id */
208
	ng_ID_t			node_id;		/* tee node id */
208
	ng_ID_t			node_id;		/* tee node id */
209
	char			hook[NG_HOOKLEN + 1];	/* session hook name */
209
	char			hook[NG_HOOKSIZ];	/* session hook name */
210
	void			*link_cookie;		/* opaque link cookie */
210
	void			*link_cookie;		/* opaque link cookie */
211
	u_int16_t		result;			/* close result code */
211
	u_int16_t		result;			/* close result code */
212
	u_int16_t		error;			/* close error code */
212
	u_int16_t		error;			/* close error code */
Lines 612-618 Link Here
612
612
613
	/* Done */
613
	/* Done */
614
	*nodep = ctrl->node_id;
614
	*nodep = ctrl->node_id;
615
	strlcpy(hook, NG_L2TP_HOOK_LOWER, NG_HOOKLEN + 1);
615
	strlcpy(hook, NG_L2TP_HOOK_LOWER, NG_HOOKSIZ);
616
	return (ctrl);
616
	return (ctrl);
617
617
618
fail:
618
fail:
Lines 1966-1972 Link Here
1966
	    struct ng_mesg msg;
1966
	    struct ng_mesg msg;
1967
	} buf;
1967
	} buf;
1968
	struct ng_mesg *const msg = &buf.msg;
1968
	struct ng_mesg *const msg = &buf.msg;
1969
	char raddr[NG_PATHLEN + 1];
1969
	char raddr[NG_PATHSIZ];
1970
	int len;
1970
	int len;
1971
1971
1972
	/* Read netgraph control message */
1972
	/* Read netgraph control message */
(-)src/l2tp_ctrl.h (-1 / +1 lines)
Lines 221-227 Link Here
221
 *	peer_id	Unique identifier for peer (used for tie-breakers)
221
 *	peer_id	Unique identifier for peer (used for tie-breakers)
222
 *	initiate Whether to send a SCCRQ or just wait for one
222
 *	initiate Whether to send a SCCRQ or just wait for one
223
 *	nodep	Pointer to netgraph node ID variable
223
 *	nodep	Pointer to netgraph node ID variable
224
 *	hook	Buffer for hook on L2TP netgraph node (size >= NG_HOOKLEN + 1)
224
 *	hook	Buffer for hook on L2TP netgraph node (size >= NG_HOOKSIZ)
225
 *	avps	List of AVP's to include in the associated
225
 *	avps	List of AVP's to include in the associated
226
 *		Start-Control-Connection-Request or
226
 *		Start-Control-Connection-Request or
227
 *		Start-Control-Connection-Reply control message.
227
 *		Start-Control-Connection-Reply control message.
(-)src/modem.c (-6 / +6 lines)
Lines 71-77 Link Here
71
    int			speed;			/* Port speed */
71
    int			speed;			/* Port speed */
72
    u_int		watch;			/* Signals to watch */
72
    u_int		watch;			/* Signals to watch */
73
    char		device[20];		/* Serial device name */
73
    char		device[20];		/* Serial device name */
74
    char		ttynode[NG_NODELEN + 1];	/* TTY node name */
74
    char		ttynode[NG_NODESIZ];	/* TTY node name */
75
    char		connScript[CHAT_MAX_LABEL];	/* Connect script */
75
    char		connScript[CHAT_MAX_LABEL];	/* Connect script */
76
    char		idleScript[CHAT_MAX_LABEL];	/* Idle script */
76
    char		idleScript[CHAT_MAX_LABEL];	/* Idle script */
77
    struct pppTimer	checkTimer;		/* Timer to check pins */
77
    struct pppTimer	checkTimer;		/* Timer to check pins */
Lines 329-335 Link Here
329
ModemDoClose(PhysInfo p, int opened)
329
ModemDoClose(PhysInfo p, int opened)
330
{
330
{
331
  ModemInfo     const m = (ModemInfo) p->info;
331
  ModemInfo     const m = (ModemInfo) p->info;
332
  char		path[NG_PATHLEN + 1];
332
  char		path[NG_PATHSIZ];
333
  const char	ch = ' ';
333
  const char	ch = ' ';
334
334
335
  /* Shutdown everything */
335
  /* Shutdown everything */
Lines 365-371 Link Here
365
ModemSetAccm(PhysInfo p, u_int32_t xmit, u_int32_t recv)
365
ModemSetAccm(PhysInfo p, u_int32_t xmit, u_int32_t recv)
366
{
366
{
367
  ModemInfo		const m = (ModemInfo) p->info;
367
  ModemInfo		const m = (ModemInfo) p->info;
368
  char        		path[NG_PATHLEN+1];
368
  char        		path[NG_PATHSIZ];
369
369
370
  /* Update async config */
370
  /* Update async config */
371
  m->acfg.accm = xmit|recv;
371
  m->acfg.accm = xmit|recv;
Lines 506-512 Link Here
506
  struct nodeinfo	ngtty;
506
  struct nodeinfo	ngtty;
507
  struct ngm_mkpeer	ngm;
507
  struct ngm_mkpeer	ngm;
508
  struct ngm_connect	cn;
508
  struct ngm_connect	cn;
509
  char        		path[NG_PATHLEN+1];
509
  char        		path[NG_PATHSIZ];
510
  int			hotchar = PPP_FLAG;
510
  int			hotchar = PPP_FLAG;
511
  int			ldisc = NETGRAPHDISC;
511
  int			ldisc = NETGRAPHDISC;
512
512
Lines 752-758 Link Here
752
{
752
{
753
  PhysInfo		const p = (PhysInfo) arg;
753
  PhysInfo		const p = (PhysInfo) arg;
754
  ModemInfo		const m = (ModemInfo) p->info;
754
  ModemInfo		const m = (ModemInfo) p->info;
755
  char			path[NG_PATHLEN + 1];
755
  char			path[NG_PATHSIZ];
756
  struct ng_async_stat	stats;
756
  struct ng_async_stat	stats;
757
757
758
  /* Check for errors */
758
  /* Check for errors */
Lines 780-786 Link Here
780
ModemGetNgStats(PhysInfo p, struct ng_async_stat *sp)
780
ModemGetNgStats(PhysInfo p, struct ng_async_stat *sp)
781
{
781
{
782
  ModemInfo             const m = (ModemInfo) p->info;
782
  ModemInfo             const m = (ModemInfo) p->info;
783
  char			path[NG_PATHLEN + 1];
783
  char			path[NG_PATHSIZ];
784
  union {
784
  union {
785
    u_char		buf[sizeof(struct ng_mesg) + sizeof(*sp)];
785
    u_char		buf[sizeof(struct ng_mesg) + sizeof(*sp)];
786
    struct ng_mesg	resp;
786
    struct ng_mesg	resp;
(-)src/ng.c (-3 / +3 lines)
Lines 31-38 Link Here
31
  #define NG_REOPEN_PAUSE	5
31
  #define NG_REOPEN_PAUSE	5
32
32
33
  struct nginfo {
33
  struct nginfo {
34
    char	path[NG_PATHLEN + 1];	/* Node that takes PPP frames */
34
    char	path[NG_PATHSIZ];	/* Node that takes PPP frames */
35
    char	hook[NG_HOOKLEN + 1];	/* Hook on that node */
35
    char	hook[NG_HOOKSIZ];	/* Hook on that node */
36
  };
36
  };
37
  typedef struct nginfo	*NgInfo;
37
  typedef struct nginfo	*NgInfo;
38
38
Lines 109-115 Link Here
109
NgOpen(PhysInfo p)
109
NgOpen(PhysInfo p)
110
{
110
{
111
    NgInfo	const ng = (NgInfo) p->info;
111
    NgInfo	const ng = (NgInfo) p->info;
112
    char	path[NG_PATHLEN + 1];
112
    char	path[NG_PATHSIZ];
113
    int		csock = -1;
113
    int		csock = -1;
114
    struct ngm_connect	cn;
114
    struct ngm_connect	cn;
115
115
(-)src/ngfunc.c (-8 / +8 lines)
Lines 127-133 Link Here
127
int
127
int
128
NgFuncInitGlobalNetflow(Bund b)
128
NgFuncInitGlobalNetflow(Bund b)
129
{
129
{
130
    char path[NG_PATHLEN + 1];
130
    char path[NG_PATHSIZ];
131
131
132
      snprintf(gNetflowNodeName, sizeof(gNetflowNodeName), "mpd%d-nf", gPid);
132
      snprintf(gNetflowNodeName, sizeof(gNetflowNodeName), "mpd%d-nf", gPid);
133
133
Lines 251-257 Link Here
251
      u_char		buf[sizeof(struct ng_mesg) + sizeof(struct nodeinfo)];
251
      u_char		buf[sizeof(struct ng_mesg) + sizeof(struct nodeinfo)];
252
      struct ng_mesg	reply;
252
      struct ng_mesg	reply;
253
  }			u;
253
  }			u;
254
  char		path[NG_PATHLEN + 1];
254
  char		path[NG_PATHSIZ];
255
  char		*eptr;
255
  char		*eptr;
256
  int		ifnum;
256
  int		ifnum;
257
257
Lines 372-378 Link Here
372
NgFuncShutdownGlobal(Bund b)
372
NgFuncShutdownGlobal(Bund b)
373
{
373
{
374
#ifdef USE_NG_NETFLOW
374
#ifdef USE_NG_NETFLOW
375
  char	path[NG_PATHLEN + 1];
375
  char	path[NG_PATHSIZ];
376
376
377
  if (gNetflowNode == FALSE || gNetflowNodeShutdown==FALSE)
377
  if (gNetflowNode == FALSE || gNetflowNodeShutdown==FALSE)
378
    return;
378
    return;
Lines 573-585 Link Here
573
int
573
int
574
NgFuncWriteFrame(Bund b, const char *hookname, Mbuf bp)
574
NgFuncWriteFrame(Bund b, const char *hookname, Mbuf bp)
575
{
575
{
576
  u_char		buf[sizeof(struct sockaddr_ng) + NG_HOOKLEN];
576
  u_char		buf[sizeof(struct sockaddr_ng) + NG_HOOKSIZ - 1];
577
  struct sockaddr_ng	*ng = (struct sockaddr_ng *)buf;
577
  struct sockaddr_ng	*ng = (struct sockaddr_ng *)buf;
578
  int			rtn;
578
  int			rtn;
579
579
580
  /* Set dest address */
580
  /* Set dest address */
581
  memset(&buf, 0, sizeof(buf));
581
  memset(&buf, 0, sizeof(buf));
582
  snprintf(ng->sg_data, NG_HOOKLEN + 1, "%s", hookname);
582
  snprintf(ng->sg_data, NG_HOOKSIZ, "%s", hookname);
583
  ng->sg_family = AF_NETGRAPH;
583
  ng->sg_family = AF_NETGRAPH;
584
  ng->sg_len = 3 + strlen(ng->sg_data);
584
  ng->sg_len = 3 + strlen(ng->sg_data);
585
585
Lines 609-615 Link Here
609
int
609
int
610
NgFuncClrStats(Bund b, u_int16_t linkNum)
610
NgFuncClrStats(Bund b, u_int16_t linkNum)
611
{
611
{
612
    char	path[NG_PATHLEN + 1];
612
    char	path[NG_PATHSIZ];
613
613
614
    /* Get stats */
614
    /* Get stats */
615
    snprintf(path, sizeof(path), "mpd%d-%s:", gPid, b->name);
615
    snprintf(path, sizeof(path), "mpd%d-%s:", gPid, b->name);
Lines 636-642 Link Here
636
				  + sizeof(struct ng_ppp_link_stat)];
636
				  + sizeof(struct ng_ppp_link_stat)];
637
      struct ng_mesg		reply;
637
      struct ng_mesg		reply;
638
  }				u;
638
  }				u;
639
  char                          path[NG_PATHLEN + 1];
639
  char                          path[NG_PATHSIZ];
640
640
641
  /* Get stats */
641
  /* Get stats */
642
  snprintf(path, sizeof(path), "mpd%d-%s:", gPid, b->name);
642
  snprintf(path, sizeof(path), "mpd%d-%s:", gPid, b->name);
Lines 666-672 Link Here
666
				  + sizeof(struct ng_ppp_link_stat64)];
666
				  + sizeof(struct ng_ppp_link_stat64)];
667
      struct ng_mesg		reply;
667
      struct ng_mesg		reply;
668
  }				u;
668
  }				u;
669
  char                          path[NG_PATHLEN + 1];
669
  char                          path[NG_PATHSIZ];
670
670
671
  /* Get stats */
671
  /* Get stats */
672
  snprintf(path, sizeof(path), "mpd%d-%s:", gPid, b->name);
672
  snprintf(path, sizeof(path), "mpd%d-%s:", gPid, b->name);
(-)src/phys.c (-2 / +2 lines)
Lines 254-261 Link Here
254
PhysGetUpperHook(PhysInfo p, char *path, char *hook)
254
PhysGetUpperHook(PhysInfo p, char *path, char *hook)
255
{
255
{
256
    if (p->link && p->link->bund) {
256
    if (p->link && p->link->bund) {
257
	snprintf(path, NG_PATHLEN, "[%lx]:", (u_long)p->link->bund->nodeID);
257
	snprintf(path, NG_PATHSIZ - 1, "[%lx]:", (u_long)p->link->bund->nodeID);
258
	snprintf(hook, NG_HOOKLEN, "%s%d",
258
	snprintf(hook, NG_HOOKSIZ - 1, "%s%d",
259
	    NG_PPP_HOOK_LINK_PREFIX, p->link->bundleIndex);
259
	    NG_PPP_HOOK_LINK_PREFIX, p->link->bundleIndex);
260
	return 1;
260
	return 1;
261
    } else if (p->rep) {
261
    } else if (p->rep) {
(-)src/pppoe.c (-14 / +14 lines)
Lines 43-55 Link Here
43
43
44
#define PPPOE_MAXPARENTIFS	1024
44
#define PPPOE_MAXPARENTIFS	1024
45
45
46
#define MAX_PATH		64	/* XXX should be NG_PATHLEN */
46
#define MAX_PATH		64	/* XXX should be NG_PATHSIZ - 1 */
47
#define MAX_SESSION		64	/* max length of PPPoE session name */
47
#define MAX_SESSION		64	/* max length of PPPoE session name */
48
48
49
/* Per link private info */
49
/* Per link private info */
50
struct pppoeinfo {
50
struct pppoeinfo {
51
	char		path[MAX_PATH];		/* PPPoE node path */
51
	char		path[MAX_PATH];		/* PPPoE node path */
52
	char		hook[NG_HOOKLEN + 1];	/* hook on that node */
52
	char		hook[NG_HOOKSIZ];	/* hook on that node */
53
	char		session[MAX_SESSION];	/* session name */
53
	char		session[MAX_SESSION];	/* session name */
54
	char		acname[PPPOE_SERVICE_NAME_SIZE];	/* AC name */
54
	char		acname[PPPOE_SERVICE_NAME_SIZE];	/* AC name */
55
	u_char		peeraddr[6];		/* Peer MAC address */
55
	u_char		peeraddr[6];		/* Peer MAC address */
Lines 220-227 Link Here
220
	    struct ngpppoe_init_data	poeid;
220
	    struct ngpppoe_init_data	poeid;
221
	} u;
221
	} u;
222
	struct ngpppoe_init_data *const idata = &u.poeid;
222
	struct ngpppoe_init_data *const idata = &u.poeid;
223
	char path[NG_PATHLEN + 1];
223
	char path[NG_PATHSIZ];
224
	char session_hook[NG_HOOKLEN + 1];
224
	char session_hook[NG_HOOKSIZ];
225
225
226
	pe->opened=1;
226
	pe->opened=1;
227
227
Lines 374-381 Link Here
374
PppoeShutdown(PhysInfo p)
374
PppoeShutdown(PhysInfo p)
375
{
375
{
376
	const PppoeInfo pi = (PppoeInfo)p->info;
376
	const PppoeInfo pi = (PppoeInfo)p->info;
377
	char path[NG_PATHLEN + 1];
377
	char path[NG_PATHSIZ];
378
	char session_hook[NG_HOOKLEN + 1];
378
	char session_hook[NG_HOOKSIZ];
379
379
380
	if (p->state == PHYS_STATE_DOWN)
380
	if (p->state == PHYS_STATE_DOWN)
381
		return;
381
		return;
Lines 403-413 Link Here
403
	    u_char buf[sizeof(struct ng_mesg) + sizeof(struct ngpppoe_sts)];
403
	    u_char buf[sizeof(struct ng_mesg) + sizeof(struct ngpppoe_sts)];
404
	    struct ng_mesg resp;
404
	    struct ng_mesg resp;
405
	} u;
405
	} u;
406
	char path[NG_PATHLEN + 1];
406
	char path[NG_PATHSIZ];
407
	PhysInfo p = NULL;
407
	PhysInfo p = NULL;
408
	PppoeInfo pi = NULL;
408
	PppoeInfo pi = NULL;
409
	int k;
409
	int k;
410
	char ppphook[NG_HOOKLEN + 1];
410
	char ppphook[NG_HOOKSIZ];
411
	
411
	
412
	struct PppoeIf  *PIf=(struct PppoeIf*)arg;
412
	struct PppoeIf  *PIf=(struct PppoeIf*)arg;
413
	
413
	
Lines 436-442 Link Here
436
		    p = gPhyses[k];
436
		    p = gPhyses[k];
437
		    pi = (PppoeInfo)p->info;
437
		    pi = (PppoeInfo)p->info;
438
		    
438
		    
439
		    snprintf(ppphook, NG_HOOKLEN, "mpd%d-%s", gPid, p->name);
439
		    snprintf(ppphook, NG_HOOKSIZ - 1, "mpd%d-%s", gPid, p->name);
440
		
440
		
441
		    if ((PIf==pi->PIf) &&
441
		    if ((PIf==pi->PIf) &&
442
			(strcmp(ppphook, ((struct ngpppoe_sts *)u.resp.data)->hook) == 0))
442
			(strcmp(ppphook, ((struct ngpppoe_sts *)u.resp.data)->hook) == 0))
Lines 747-758 Link Here
747
{
747
{
748
	int i,k,sz;
748
	int i,k,sz;
749
	struct PppoeIf *PIf=(struct PppoeIf *)(arg);
749
	struct PppoeIf *PIf=(struct PppoeIf *)(arg);
750
	char rhook[NG_HOOKLEN + 1];
750
	char rhook[NG_HOOKSIZ];
751
	unsigned char response[1024];
751
	unsigned char response[1024];
752
752
753
	char path[NG_PATHLEN + 1];
753
	char path[NG_PATHSIZ];
754
	char path1[NG_PATHLEN + 1];
754
	char path1[NG_PATHSIZ];
755
	char session_hook[NG_HOOKLEN + 1];
755
	char session_hook[NG_HOOKSIZ];
756
	struct ngm_connect      cn;
756
	struct ngm_connect      cn;
757
	struct ngm_mkpeer 	mp;
757
	struct ngm_mkpeer 	mp;
758
	u_char *macaddr;
758
	u_char *macaddr;
Lines 949-955 Link Here
949
	    struct ngpppoe_init_data	poeid;
949
	    struct ngpppoe_init_data	poeid;
950
	} u;
950
	} u;
951
	struct ngpppoe_init_data *const idata = &u.poeid;
951
	struct ngpppoe_init_data *const idata = &u.poeid;
952
	char pat[NG_PATHLEN + 1];
952
	char pat[NG_PATHSIZ];
953
	struct ngm_connect	cn;
953
	struct ngm_connect	cn;
954
	
954
	
955
	if (n) {
955
	if (n) {
(-)src/pptp.c (-5 / +5 lines)
Lines 371-377 Link Here
371
PptpKillNode(PhysInfo p)
371
PptpKillNode(PhysInfo p)
372
{
372
{
373
	PptpInfo const	pptp = (PptpInfo) p->info;
373
	PptpInfo const	pptp = (PptpInfo) p->info;
374
	char		path[NG_PATHLEN + 1];
374
	char		path[NG_PATHSIZ];
375
	int		csock = -1;
375
	int		csock = -1;
376
376
377
	if (pptp->node_id == 0)
377
	if (pptp->node_id == 0)
Lines 642-649 Link Here
642
PptpHookUp(PhysInfo p)
642
PptpHookUp(PhysInfo p)
643
{
643
{
644
  const PptpInfo		pi = (PptpInfo)p->info;
644
  const PptpInfo		pi = (PptpInfo)p->info;
645
  char	        		ksockpath[NG_PATHLEN+1];
645
  char	        		ksockpath[NG_PATHSIZ];
646
  char	        		pptppath[NG_PATHLEN+1];
646
  char	        		pptppath[NG_PATHSIZ];
647
  struct ngm_mkpeer		mkp;
647
  struct ngm_mkpeer		mkp;
648
  struct ng_pptpgre_conf	gc;
648
  struct ng_pptpgre_conf	gc;
649
  struct sockaddr_storage	self_addr, peer_addr;
649
  struct sockaddr_storage	self_addr, peer_addr;
Lines 654-661 Link Here
654
  } u;
654
  } u;
655
  struct ng_ksocket_sockopt *const ksso = &u.ksso;
655
  struct ng_ksocket_sockopt *const ksso = &u.ksso;
656
  int		csock = -1;
656
  int		csock = -1;
657
  char        	path[NG_PATHLEN + 1];
657
  char        	path[NG_PATHSIZ];
658
  char		hook[NG_HOOKLEN + 1];
658
  char		hook[NG_HOOKSIZ];
659
659
660
  /* Get session info */
660
  /* Get session info */
661
  memset(&gc, 0, sizeof(gc));
661
  memset(&gc, 0, sizeof(gc));
(-)src/rep.c (-6 / +6 lines)
Lines 172-178 Link Here
172
    }
172
    }
173
173
174
    if (r->p_up == 3 && r->csock > 0 && r->node_id) {
174
    if (r->p_up == 3 && r->csock > 0 && r->node_id) {
175
	char path[NG_PATHLEN + 1];
175
	char path[NG_PATHSIZ];
176
	
176
	
177
	snprintf(path, sizeof(path), "[%x]:", r->node_id);
177
	snprintf(path, sizeof(path), "[%x]:", r->node_id);
178
	NgFuncShutdownNode(r->csock, r->name, path);
178
	NgFuncShutdownNode(r->csock, r->name, path);
Lines 201-207 Link Here
201
    PhysClose(r->physes[1]);
201
    PhysClose(r->physes[1]);
202
202
203
    if (r->csock > 0 && r->node_id) {
203
    if (r->csock > 0 && r->node_id) {
204
	char path[NG_PATHLEN + 1];
204
	char path[NG_PATHSIZ];
205
	
205
	
206
	snprintf(path, sizeof(path), "[%x]:", r->node_id);
206
	snprintf(path, sizeof(path), "[%x]:", r->node_id);
207
	NgFuncShutdownNode(r->csock, r->name, path);
207
	NgFuncShutdownNode(r->csock, r->name, path);
Lines 251-261 Link Here
251
    if (r->node_id == 0)
251
    if (r->node_id == 0)
252
	return (0);
252
	return (0);
253
253
254
    snprintf(path, NG_PATHLEN, "[%lx]:", (u_long)r->node_id);
254
    snprintf(path, NG_PATHSIZ - 1, "[%lx]:", (u_long)r->node_id);
255
    if (n == 0)
255
    if (n == 0)
256
	snprintf(hook, NG_HOOKLEN, NG_TEE_HOOK_LEFT);
256
	snprintf(hook, NG_HOOKSIZ - 1, NG_TEE_HOOK_LEFT);
257
    else
257
    else
258
	snprintf(hook, NG_HOOKLEN, NG_TEE_HOOK_RIGHT);
258
	snprintf(hook, NG_HOOKSIZ - 1, NG_TEE_HOOK_RIGHT);
259
    return (1);
259
    return (1);
260
}
260
}
261
261
Lines 395-401 Link Here
395
	gReps[k] = NULL;
395
	gReps[k] = NULL;
396
396
397
    if (r->csock > 0 && r->node_id) {
397
    if (r->csock > 0 && r->node_id) {
398
	char path[NG_PATHLEN + 1];
398
	char path[NG_PATHSIZ];
399
	
399
	
400
	snprintf(path, sizeof(path), "[%x]:", r->node_id);
400
	snprintf(path, sizeof(path), "[%x]:", r->node_id);
401
	NgFuncShutdownNode(r->csock, r->name, path);
401
	NgFuncShutdownNode(r->csock, r->name, path);
(-)src/tcp.c (-5 / +5 lines)
Lines 182-189 Link Here
182
	struct ngm_mkpeer	mkp;
182
	struct ngm_mkpeer	mkp;
183
	struct ngm_connect	cn;
183
	struct ngm_connect	cn;
184
	struct ngm_name		nm;
184
	struct ngm_name		nm;
185
	char 			path[NG_PATHLEN + 1];
185
	char 			path[NG_PATHSIZ];
186
	char 			hook[NG_HOOKLEN + 1];
186
	char 			hook[NG_HOOKSIZ];
187
	struct sockaddr_storage addr;
187
	struct sockaddr_storage addr;
188
	struct ng_async_cfg	acfg;
188
	struct ng_async_cfg	acfg;
189
	int 			rval;
189
	int 			rval;
Lines 349-355 Link Here
349
	} cn;
349
	} cn;
350
	PhysInfo	p;
350
	PhysInfo	p;
351
	TcpInfo		pi;
351
	TcpInfo		pi;
352
	char path[NG_PATHLEN + 1];
352
	char path[NG_PATHSIZ];
353
353
354
	/* Restore context. */
354
	/* Restore context. */
355
	p = (PhysInfo)cookie;
355
	p = (PhysInfo)cookie;
Lines 399-405 Link Here
399
		struct sockaddr_storage sin;
399
		struct sockaddr_storage sin;
400
	} ac;
400
	} ac;
401
	struct ngm_name         nm;
401
	struct ngm_name         nm;
402
	char path[NG_PATHLEN + 1];
402
	char path[NG_PATHSIZ];
403
	struct u_addr	addr;
403
	struct u_addr	addr;
404
	in_port_t	port;
404
	in_port_t	port;
405
	char		buf[64];
405
	char		buf[64];
Lines 537-543 Link Here
537
static void
537
static void
538
TcpDoClose(PhysInfo p)
538
TcpDoClose(PhysInfo p)
539
{
539
{
540
	char path[NG_PATHLEN + 1];
540
	char path[NG_PATHSIZ];
541
	TcpInfo const pi = (TcpInfo) p->info;
541
	TcpInfo const pi = (TcpInfo) p->info;
542
542
543
	EventUnRegister(&pi->ev_connect);
543
	EventUnRegister(&pi->ev_connect);
(-)src/udp.c (-3 / +3 lines)
Lines 174-181 Link Here
174
UdpOpen(PhysInfo p)
174
UdpOpen(PhysInfo p)
175
{
175
{
176
	UdpInfo			const pi = (UdpInfo) p->info;
176
	UdpInfo			const pi = (UdpInfo) p->info;
177
	char        		path[NG_PATHLEN+1];
177
	char        		path[NG_PATHSIZ];
178
	char        		hook[NG_HOOKLEN+1];
178
	char        		hook[NG_HOOKSIZ];
179
	struct ngm_mkpeer	mkp;
179
	struct ngm_mkpeer	mkp;
180
	struct ngm_name         nm;
180
	struct ngm_name         nm;
181
	struct sockaddr_storage	addr;
181
	struct sockaddr_storage	addr;
Lines 321-327 Link Here
321
UdpDoClose(PhysInfo p)
321
UdpDoClose(PhysInfo p)
322
{
322
{
323
	UdpInfo	const pi = (UdpInfo) p->info;
323
	UdpInfo	const pi = (UdpInfo) p->info;
324
	char	path[NG_PATHLEN + 1];
324
	char	path[NG_PATHSIZ];
325
	int	csock;
325
	int	csock;
326
326
327
	if (pi->node_id == 0)
327
	if (pi->node_id == 0)

Return to bug 275112