Replaced direct access to max_xxx variables with get/set_max_xxx.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5025 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Waldemar Kornewald 2003-10-14 10:15:31 +00:00
parent 13b219e125
commit f5ef266db8
3 changed files with 8 additions and 8 deletions

View File

@ -151,7 +151,7 @@ static struct mbuf *ip_insertoptions(struct mbuf *m, struct mbuf *opt, int *phle
n->m_next = m; n->m_next = m;
m = n; m = n;
m->m_len = optlen + sizeof(struct ip); m->m_len = optlen + sizeof(struct ip);
m->m_data += max_linkhdr; m->m_data += get_max_linkhdr();
memcpy(mtod(m, void *), ip, sizeof(struct ip)); memcpy(mtod(m, void *), ip, sizeof(struct ip));
} else { } else {
m->m_data -= optlen; m->m_data -= optlen;
@ -965,7 +965,7 @@ static int ipv4_output(struct mbuf *m0, struct mbuf *opt, struct route *ro,
ipstat.ips_odropped++; ipstat.ips_odropped++;
goto sendorfree; goto sendorfree;
} }
m->m_data += max_linkhdr; m->m_data += get_max_linkhdr();
mhip = mtod(m, struct ip*); mhip = mtod(m, struct ip*);
*mhip = *ip; *mhip = *ip;
if (hlen > sizeof(struct ip)) { if (hlen > sizeof(struct ip)) {

View File

@ -73,8 +73,8 @@ void tcp_init(void)
tcp_iss = 1; tcp_iss = 1;
tcb.inp_next = tcb.inp_prev = &tcb; tcb.inp_next = tcb.inp_prev = &tcb;
if (max_protohdr < sizeof(struct tcpiphdr)) if (get_max_protohdr() < sizeof(struct tcpiphdr))
max_protohdr = sizeof(struct tcpiphdr); set_max_protohdr(sizeof(struct tcpiphdr));
memset(&tcpstat, 0, sizeof(struct tcpstat)); memset(&tcpstat, 0, sizeof(struct tcpstat));
memset(proto, 0, sizeof(struct protosw *) * IPPROTO_MAX); memset(proto, 0, sizeof(struct protosw *) * IPPROTO_MAX);
@ -238,7 +238,7 @@ void tcp_respond(struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m,
if (!m) if (!m)
return; return;
tlen = 0; tlen = 0;
m->m_data += max_linkhdr; m->m_data += get_max_linkhdr();
*mtod(m, struct tcpiphdr*) = *ti; *mtod(m, struct tcpiphdr*) = *ti;
ti = mtod(m, struct tcpiphdr*); ti = mtod(m, struct tcpiphdr*);
flags = TH_ACK; flags = TH_ACK;

View File

@ -315,9 +315,9 @@ send:
error = ENOBUFS; error = ENOBUFS;
goto out; goto out;
} }
m->m_data += max_linkhdr; m->m_data += get_max_linkhdr();
m->m_len = hdrlen; m->m_len = hdrlen;
if (len <= MHLEN - hdrlen - max_linkhdr) { if (len <= MHLEN - hdrlen - get_max_linkhdr()) {
m_copydata(so->so_snd.sb_mb, off, (int)len, mtod(m, caddr_t) + hdrlen); m_copydata(so->so_snd.sb_mb, off, (int)len, mtod(m, caddr_t) + hdrlen);
m->m_len += len; m->m_len += len;
} else { } else {
@ -343,7 +343,7 @@ send:
error = ENOBUFS; error = ENOBUFS;
goto out; goto out;
} }
m->m_data += max_linkhdr; m->m_data += get_max_linkhdr();
m->m_len = hdrlen; m->m_len = hdrlen;
} }
m->m_pkthdr.rcvif = NULL; m->m_pkthdr.rcvif = NULL;