Exemplo n.º 1
0
Arquivo: arp.c Projeto: 274914765/C
static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip)
{
    int scope;

    switch (IN_DEV_ARP_IGNORE(in_dev)) {
    case 0:    /* Reply, the tip is already validated */
        return 0;
    case 1:    /* Reply only if tip is configured on the incoming interface */
        sip = 0;
        scope = RT_SCOPE_HOST;
        break;
    case 2:    /*
         * Reply only if tip is configured on the incoming interface
         * and is in same subnet as sip
         */
        scope = RT_SCOPE_HOST;
        break;
    case 3:    /* Do not reply for scope host addresses */
        sip = 0;
        scope = RT_SCOPE_LINK;
        break;
    case 4:    /* Reserved */
    case 5:
    case 6:
    case 7:
        return 0;
    case 8:    /* Do not reply */
        return 1;
    default:
        return 0;
    }
    return !inet_confirm_addr(in_dev, sip, tip, scope);
}
Exemplo n.º 2
0
static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip)
{
	int scope;

	switch (IN_DEV_ARP_IGNORE(in_dev)) {
	case 0:	
		return 0;
	case 1:	
		sip = 0;
		scope = RT_SCOPE_HOST;
		break;
	case 2:	
		scope = RT_SCOPE_HOST;
		break;
	case 3:	
		sip = 0;
		scope = RT_SCOPE_LINK;
		break;
	case 4:	
	case 5:
	case 6:
	case 7:
		return 0;
	case 8:	
		return 1;
	default:
		return 0;
	}
	return !inet_confirm_addr(in_dev, sip, tip, scope);
}