Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Sep 8, 2005
2 parents e72225d + 832079d commit f7402dc
Show file tree
Hide file tree
Showing 35 changed files with 356 additions and 105 deletions.
12 changes: 9 additions & 3 deletions crypto/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,16 @@ static unsigned int cbc_process_encrypt(const struct cipher_desc *desc,
u8 *iv = desc->info;
unsigned int done = 0;

nbytes -= bsize;

do {
xor(iv, src);
fn(crypto_tfm_ctx(tfm), dst, iv);
memcpy(iv, dst, bsize);

src += bsize;
dst += bsize;
} while ((done += bsize) < nbytes);
} while ((done += bsize) <= nbytes);

return done;
}
Expand All @@ -219,6 +221,8 @@ static unsigned int cbc_process_decrypt(const struct cipher_desc *desc,
u8 *iv = desc->info;
unsigned int done = 0;

nbytes -= bsize;

do {
u8 *tmp_dst = *dst_p;

Expand All @@ -230,7 +234,7 @@ static unsigned int cbc_process_decrypt(const struct cipher_desc *desc,

src += bsize;
dst += bsize;
} while ((done += bsize) < nbytes);
} while ((done += bsize) <= nbytes);

return done;
}
Expand All @@ -243,12 +247,14 @@ static unsigned int ecb_process(const struct cipher_desc *desc, u8 *dst,
void (*fn)(void *, u8 *, const u8 *) = desc->crfn;
unsigned int done = 0;

nbytes -= bsize;

do {
fn(crypto_tfm_ctx(tfm), dst, src);

src += bsize;
dst += bsize;
} while ((done += bsize) < nbytes);
} while ((done += bsize) <= nbytes);

return done;
}
Expand Down
25 changes: 17 additions & 8 deletions drivers/net/arcnet/arcnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
struct ArcProto *proto;
int txbuf;
unsigned long flags;
int freeskb = 0;
int freeskb, retval;

BUGMSG(D_DURING,
"transmit requested (status=%Xh, txbufs=%d/%d, len=%d, protocol %x)\n",
Expand All @@ -615,16 +615,19 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
if (skb->len - ARC_HDR_SIZE > XMTU && !proto->continue_tx) {
BUGMSG(D_NORMAL, "fixme: packet too large: compensating badly!\n");
dev_kfree_skb(skb);
return 0; /* don't try again */
return NETDEV_TX_OK; /* don't try again */
}

/* We're busy transmitting a packet... */
netif_stop_queue(dev);

spin_lock_irqsave(&lp->lock, flags);
AINTMASK(0);

txbuf = get_arcbuf(dev);
if(lp->next_tx == -1)
txbuf = get_arcbuf(dev);
else {
txbuf = -1;
}
if (txbuf != -1) {
if (proto->prepare_tx(dev, pkt, skb->len, txbuf) &&
!proto->ack_tx) {
Expand All @@ -638,17 +641,21 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
lp->outgoing.skb = skb;
lp->outgoing.pkt = pkt;

freeskb = 0;

if (proto->continue_tx &&
proto->continue_tx(dev, txbuf)) {
BUGMSG(D_NORMAL,
"bug! continue_tx finished the first time! "
"(proto='%c')\n", proto->suffix);
}
}

retval = NETDEV_TX_OK;
dev->trans_start = jiffies;
lp->next_tx = txbuf;
} else {
freeskb = 1;
retval = NETDEV_TX_BUSY;
freeskb = 0;
}

BUGMSG(D_DEBUG, "%s: %d: %s, status: %x\n",__FILE__,__LINE__,__FUNCTION__,ASTATUS());
Expand All @@ -664,7 +671,7 @@ static int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev)
if (freeskb) {
dev_kfree_skb(skb);
}
return 0; /* no need to try again */
return retval; /* no need to try again */
}


Expand All @@ -690,7 +697,6 @@ static int go_tx(struct net_device *dev)
/* start sending */
ACOMMAND(TXcmd | (lp->cur_tx << 3));

dev->trans_start = jiffies;
lp->stats.tx_packets++;
lp->lasttrans_dest = lp->lastload_dest;
lp->lastload_dest = 0;
Expand Down Expand Up @@ -917,6 +923,9 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs)

BUGMSG(D_RECON, "Network reconfiguration detected (status=%Xh)\n",
status);
/* MYRECON bit is at bit 7 of diagstatus */
if(diagstatus & 0x80)
BUGMSG(D_RECON,"Put out that recon myself\n");

/* is the RECON info empty or old? */
if (!lp->first_recon || !lp->last_recon ||
Expand Down
5 changes: 5 additions & 0 deletions include/linux/netfilter_ipv4/ip_conntrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ struct ip_conntrack_expect
/* Unique ID */
unsigned int id;

/* Flags */
unsigned int flags;

#ifdef CONFIG_IP_NF_NAT_NEEDED
/* This is the original per-proto part, used to map the
* expected connection the way the recipient expects. */
Expand All @@ -272,6 +275,8 @@ struct ip_conntrack_expect
#endif
};

#define IP_CT_EXPECT_PERMANENT 0x1

static inline struct ip_conntrack *
tuplehash_to_ctrack(const struct ip_conntrack_tuple_hash *hash)
{
Expand Down
2 changes: 1 addition & 1 deletion include/linux/netfilter_ipv4/ip_conntrack_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static inline int ip_conntrack_confirm(struct sk_buff **pskb)
return ret;
}

extern void __ip_ct_expect_unlink_destroy(struct ip_conntrack_expect *exp);
extern void ip_ct_unlink_expect(struct ip_conntrack_expect *exp);

extern struct list_head *ip_conntrack_hash;
extern struct list_head ip_conntrack_expect_list;
Expand Down
5 changes: 5 additions & 0 deletions include/linux/netfilter_ipv4/ip_nat_rule.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ extern unsigned int
alloc_null_binding(struct ip_conntrack *conntrack,
struct ip_nat_info *info,
unsigned int hooknum);

extern unsigned int
alloc_null_binding_confirmed(struct ip_conntrack *conntrack,
struct ip_nat_info *info,
unsigned int hooknum);
#endif
#endif /* _IP_NAT_RULE_H */
4 changes: 2 additions & 2 deletions include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ extern void skb_add_mtu(int mtu);
* This function converts the offset back to a struct timeval and stores
* it in stamp.
*/
static inline void skb_get_timestamp(struct sk_buff *skb, struct timeval *stamp)
static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval *stamp)
{
stamp->tv_sec = skb->tstamp.off_sec;
stamp->tv_usec = skb->tstamp.off_usec;
Expand All @@ -1270,7 +1270,7 @@ static inline void skb_get_timestamp(struct sk_buff *skb, struct timeval *stamp)
* This function converts a struct timeval to an offset and stores
* it in the skb.
*/
static inline void skb_set_timestamp(struct sk_buff *skb, struct timeval *stamp)
static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp)
{
skb->tstamp.off_sec = stamp->tv_sec - skb_tv_base.tv_sec;
skb->tstamp.off_usec = stamp->tv_usec - skb_tv_base.tv_usec;
Expand Down
2 changes: 1 addition & 1 deletion include/net/ax25.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *);

/* ax25_addr.c */
extern ax25_address null_ax25_address;
extern char *ax2asc(ax25_address *);
extern char *ax2asc(char *buf, ax25_address *);
extern ax25_address *asc2ax(char *);
extern int ax25cmp(ax25_address *, ax25_address *);
extern int ax25digicmp(ax25_digi *, ax25_digi *);
Expand Down
7 changes: 4 additions & 3 deletions net/ax25/af_ax25.c
Original file line number Diff line number Diff line change
Expand Up @@ -1874,6 +1874,7 @@ static void ax25_info_stop(struct seq_file *seq, void *v)
static int ax25_info_show(struct seq_file *seq, void *v)
{
ax25_cb *ax25 = v;
char buf[11];
int k;


Expand All @@ -1885,13 +1886,13 @@ static int ax25_info_show(struct seq_file *seq, void *v)
seq_printf(seq, "%8.8lx %s %s%s ",
(long) ax25,
ax25->ax25_dev == NULL? "???" : ax25->ax25_dev->dev->name,
ax2asc(&ax25->source_addr),
ax2asc(buf, &ax25->source_addr),
ax25->iamdigi? "*":"");
seq_printf(seq, "%s", ax2asc(&ax25->dest_addr));
seq_printf(seq, "%s", ax2asc(buf, &ax25->dest_addr));

for (k=0; (ax25->digipeat != NULL) && (k < ax25->digipeat->ndigi); k++) {
seq_printf(seq, ",%s%s",
ax2asc(&ax25->digipeat->calls[k]),
ax2asc(buf, &ax25->digipeat->calls[k]),
ax25->digipeat->repeated[k]? "*":"");
}

Expand Down
3 changes: 1 addition & 2 deletions net/ax25/ax25_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ ax25_address null_ax25_address = {{0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00}};
/*
* ax25 -> ascii conversion
*/
char *ax2asc(ax25_address *a)
char *ax2asc(char *buf, ax25_address *a)
{
static char buf[11];
char c, *s;
int n;

Expand Down
7 changes: 5 additions & 2 deletions net/ax25/ax25_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ static void ax25_rt_seq_stop(struct seq_file *seq, void *v)

static int ax25_rt_seq_show(struct seq_file *seq, void *v)
{
char buf[11];

if (v == SEQ_START_TOKEN)
seq_puts(seq, "callsign dev mode digipeaters\n");
else {
Expand All @@ -308,7 +310,7 @@ static int ax25_rt_seq_show(struct seq_file *seq, void *v)
if (ax25cmp(&ax25_rt->callsign, &null_ax25_address) == 0)
callsign = "default";
else
callsign = ax2asc(&ax25_rt->callsign);
callsign = ax2asc(buf, &ax25_rt->callsign);

seq_printf(seq, "%-9s %-4s",
callsign,
Expand All @@ -328,7 +330,8 @@ static int ax25_rt_seq_show(struct seq_file *seq, void *v)

if (ax25_rt->digipeat != NULL)
for (i = 0; i < ax25_rt->digipeat->ndigi; i++)
seq_printf(seq, " %s", ax2asc(&ax25_rt->digipeat->calls[i]));
seq_printf(seq, " %s",
ax2asc(buf, &ax25_rt->digipeat->calls[i]));

seq_puts(seq, "\n");
}
Expand Down
4 changes: 3 additions & 1 deletion net/ax25/ax25_uid.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,14 @@ static void ax25_uid_seq_stop(struct seq_file *seq, void *v)

static int ax25_uid_seq_show(struct seq_file *seq, void *v)
{
char buf[11];

if (v == SEQ_START_TOKEN)
seq_printf(seq, "Policy: %d\n", ax25_uid_policy);
else {
struct ax25_uid_assoc *pt = v;

seq_printf(seq, "%6d %s\n", pt->uid, ax2asc(&pt->call));
seq_printf(seq, "%6d %s\n", pt->uid, ax2asc(buf, &pt->call));
}
return 0;
}
Expand Down
9 changes: 4 additions & 5 deletions net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,11 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
sock_reset_flag(sk, SOCK_LINGER);
else {
#if (BITS_PER_LONG == 32)
if (ling.l_linger >= MAX_SCHEDULE_TIMEOUT/HZ)
if ((unsigned int)ling.l_linger >= MAX_SCHEDULE_TIMEOUT/HZ)
sk->sk_lingertime = MAX_SCHEDULE_TIMEOUT;
else
#endif
sk->sk_lingertime = ling.l_linger * HZ;
sk->sk_lingertime = (unsigned int)ling.l_linger * HZ;
sock_set_flag(sk, SOCK_LINGER);
}
break;
Expand Down Expand Up @@ -1529,6 +1529,8 @@ EXPORT_SYMBOL(proto_register);
void proto_unregister(struct proto *prot)
{
write_lock(&proto_list_lock);
list_del(&prot->node);
write_unlock(&proto_list_lock);

if (prot->slab != NULL) {
kmem_cache_destroy(prot->slab);
Expand All @@ -1550,9 +1552,6 @@ void proto_unregister(struct proto *prot)
kfree(name);
prot->twsk_slab = NULL;
}

list_del(&prot->node);
write_unlock(&proto_list_lock);
}

EXPORT_SYMBOL(proto_unregister);
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/ip_fragment.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ static void ip_frag_queue(struct ipq *qp, struct sk_buff *skb)

if (pskb_pull(skb, ihl) == NULL)
goto err;
if (pskb_trim(skb, end-offset))
if (pskb_trim_rcsum(skb, end-offset))
goto err;

/* Find out which fragments are in front and at the back of us
Expand Down
20 changes: 20 additions & 0 deletions net/ipv4/netfilter/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ config IP_NF_CT_ACCT

config IP_NF_CONNTRACK_MARK
bool 'Connection mark tracking support'
depends on IP_NF_CONNTRACK
help
This option enables support for connection marks, used by the
`CONNMARK' target and `connmark' match. Similar to the mark value
Expand Down Expand Up @@ -85,6 +86,25 @@ config IP_NF_IRC

To compile it as a module, choose M here. If unsure, say Y.

config IP_NF_NETBIOS_NS
tristate "NetBIOS name service protocol support (EXPERIMENTAL)"
depends on IP_NF_CONNTRACK && EXPERIMENTAL
help
NetBIOS name service requests are sent as broadcast messages from an
unprivileged port and responded to with unicast messages to the
same port. This make them hard to firewall properly because connection
tracking doesn't deal with broadcasts. This helper tracks locally
originating NetBIOS name service requests and the corresponding
responses. It relies on correct IP address configuration, specifically
netmask and broadcast address. When properly configured, the output
of "ip address show" should look similar to this:

$ ip -4 address show eth0
4: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
inet 172.16.2.252/24 brd 172.16.2.255 scope global eth0

To compile it as a module, choose M here. If unsure, say N.

config IP_NF_TFTP
tristate "TFTP protocol support"
depends on IP_NF_CONNTRACK
Expand Down
1 change: 1 addition & 0 deletions net/ipv4/netfilter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ obj-$(CONFIG_IP_NF_AMANDA) += ip_conntrack_amanda.o
obj-$(CONFIG_IP_NF_TFTP) += ip_conntrack_tftp.o
obj-$(CONFIG_IP_NF_FTP) += ip_conntrack_ftp.o
obj-$(CONFIG_IP_NF_IRC) += ip_conntrack_irc.o
obj-$(CONFIG_IP_NF_NETBIOS_NS) += ip_conntrack_netbios_ns.o

# NAT helpers
obj-$(CONFIG_IP_NF_NAT_AMANDA) += ip_nat_amanda.o
Expand Down
1 change: 1 addition & 0 deletions net/ipv4/netfilter/ip_conntrack_amanda.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static int help(struct sk_buff **pskb,
}

exp->expectfn = NULL;
exp->flags = 0;

exp->tuple.src.ip = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip;
exp->tuple.src.u.tcp.port = 0;
Expand Down
Loading

0 comments on commit f7402dc

Please sign in to comment.