Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8cf14e38 authored by Harvey Harrison's avatar Harvey Harrison Committed by David S. Miller
Browse files

net: easy removals of HIPQUAD using %pI4 format



As a bonus, removes some unnecessary byteswapping.

Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9edb8bb6
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -138,14 +138,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
	struct nes_device *nesdev;
	struct nes_device *nesdev;
	struct net_device *netdev;
	struct net_device *netdev;
	struct nes_vnic *nesvnic;
	struct nes_vnic *nesvnic;
	unsigned int addr;

	unsigned int mask;
	nes_debug(NES_DBG_NETDEV, "nes_inetaddr_event: ip address %pI4, netmask %pI4.\n",

		  &ifa->ifa_address, &ifa->ifa_mask);
	addr = ntohl(ifa->ifa_address);
	mask = ntohl(ifa->ifa_mask);
	nes_debug(NES_DBG_NETDEV, "nes_inetaddr_event: ip address " NIPQUAD_FMT
		  ", netmask " NIPQUAD_FMT ".\n",
		  HIPQUAD(addr), HIPQUAD(mask));
	list_for_each_entry(nesdev, &nes_dev_list, list) {
	list_for_each_entry(nesdev, &nes_dev_list, list) {
		nes_debug(NES_DBG_NETDEV, "Nesdev list entry = 0x%p. (%s)\n",
		nes_debug(NES_DBG_NETDEV, "Nesdev list entry = 0x%p. (%s)\n",
				nesdev, nesdev->netdev[0]->name);
				nesdev, nesdev->netdev[0]->name);
+14 −20
Original line number Original line Diff line number Diff line
@@ -1654,9 +1654,10 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb)
	unsigned char *p;
	unsigned char *p;
	int period;
	int period;
	u32 code;
	u32 code;
	u32 my_seq, addr;
	u32 my_seq;
	u32 your_seq, mask;
	u32 your_seq;
	u32 local;
	__be32 local;
	__be32 *addr, *mask;
	u16 unused;
	u16 unused;


	if (skb->len < 14)
	if (skb->len < 14)
@@ -1671,27 +1672,20 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb)
		isdn_net_ciscohdlck_slarp_send_reply(lp);
		isdn_net_ciscohdlck_slarp_send_reply(lp);
		break;
		break;
	case CISCO_SLARP_REPLY:
	case CISCO_SLARP_REPLY:
		addr = ntohl(*(u32 *)p);
		addr = (__be32 *)p;
		mask = ntohl(*(u32 *)(p+4));
		mask = (__be32 *)(p + 4);
		if (mask != 0xfffffffc)
		if (*mask != cpu_to_be32(0xfffffffc))
			goto slarp_reply_out;
			goto slarp_reply_out;
		if ((addr & 3) == 0 || (addr & 3) == 3)
		if ((*addr & cpu_to_be32(3)) == cpu_to_be32(0) ||
		    (*addr & cpu_to_be32(3)) == cpu_to_be32(3))
			goto slarp_reply_out;
			goto slarp_reply_out;
		local = addr ^ 3;
		local = *addr ^ cpu_to_be32(3);
		printk(KERN_INFO "%s: got slarp reply: "
		printk(KERN_INFO "%s: got slarp reply: remote ip: %pI4, local ip: %pI4 mask: %pI4\n",
			"remote ip: %d.%d.%d.%d, "
		       lp->netdev->dev->name, addr, &local, mask);
			"local ip: %d.%d.%d.%d "
			"mask: %d.%d.%d.%d\n",
		       lp->netdev->dev->name,
		       HIPQUAD(addr),
		       HIPQUAD(local),
		       HIPQUAD(mask));
		break;
		break;
  slarp_reply_out:
  slarp_reply_out:
		 printk(KERN_INFO "%s: got invalid slarp "
		printk(KERN_INFO "%s: got invalid slarp reply (%pI4/%pI4) - ignored\n",
				 "reply (%d.%d.%d.%d/%d.%d.%d.%d) "
		       lp->netdev->dev->name, addr, mask);
				 "- ignored\n", lp->netdev->dev->name,
				 HIPQUAD(addr), HIPQUAD(mask));
		break;
		break;
	case CISCO_SLARP_KEEPALIVE:
	case CISCO_SLARP_KEEPALIVE:
		period = (int)((jiffies - lp->cisco_last_slarp_in
		period = (int)((jiffies - lp->cisco_last_slarp_in
+1 −3
Original line number Original line Diff line number Diff line
@@ -3221,7 +3221,6 @@ static void bond_info_show_master(struct seq_file *seq)
	struct bonding *bond = seq->private;
	struct bonding *bond = seq->private;
	struct slave *curr;
	struct slave *curr;
	int i;
	int i;
	u32 target;


	read_lock(&bond->curr_slave_lock);
	read_lock(&bond->curr_slave_lock);
	curr = bond->curr_active_slave;
	curr = bond->curr_active_slave;
@@ -3275,8 +3274,7 @@ static void bond_info_show_master(struct seq_file *seq)
				continue;
				continue;
			if (printed)
			if (printed)
				seq_printf(seq, ",");
				seq_printf(seq, ",");
			target = ntohl(bond->params.arp_targets[i]);
			seq_printf(seq, " %pI4", &bond->params.arp_targets[i]);
			seq_printf(seq, " %d.%d.%d.%d", HIPQUAD(target));
			printed = 1;
			printed = 1;
		}
		}
		seq_printf(seq, "\n");
		seq_printf(seq, "\n");