Deleted Added
full compact
alist_new.c (170263) alist_new.c (172771)
1/*
2 * Copyright (C) 2006 by Darren Reed.
3 *
4 * See the IPFILTER.LICENCE file for details on licencing.
5 *
1/*
2 * Copyright (C) 2006 by Darren Reed.
3 *
4 * See the IPFILTER.LICENCE file for details on licencing.
5 *
6 * $Id: alist_new.c,v 1.1.2.2 2006/08/25 22:43:21 darrenr Exp $
6 * $Id: alist_new.c,v 1.1.2.3 2007/06/06 08:05:33 darrenr Exp $
7 */
8
9#include "ipf.h"
10
11alist_t *
12alist_new(int v, char *host)
13{
14 int a, b, c, d, bits;

--- 33 unchanged lines hidden (view full) ---

48 }
49
50 if (*host == '!') {
51 al->al_not = 1;
52 host++;
53 }
54
55 if (gethost(host, &al->al_addr) == -1) {
7 */
8
9#include "ipf.h"
10
11alist_t *
12alist_new(int v, char *host)
13{
14 int a, b, c, d, bits;

--- 33 unchanged lines hidden (view full) ---

48 }
49
50 if (*host == '!') {
51 al->al_not = 1;
52 host++;
53 }
54
55 if (gethost(host, &al->al_addr) == -1) {
56 *slash = '/';
56 if (slash != NULL)
57 *slash = '/';
57 fprintf(stderr, "Cannot parse hostname\n");
58 free(al);
59 return NULL;
60 }
61 al->al_mask = htonl(mask);
58 fprintf(stderr, "Cannot parse hostname\n");
59 free(al);
60 return NULL;
61 }
62 al->al_mask = htonl(mask);
62 *slash = '/';
63 if (slash != NULL)
64 *slash = '/';
63 return al;
64}
65 return al;
66}